LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jesper Juhl <jj@chaosbits.net>
To: linux-kernel@vger.kernel.org
Cc: netdev@vger.kernel.org, Tejun Heo <tj@kernel.org>,
	Karsten Keil <isdn@linux-pingi.de>
Subject: potential null pointer dereference in drivers/isdn/hisax/isdnl2.c
Date: Thu, 3 Feb 2011 21:27:56 +0100 (CET)	[thread overview]
Message-ID: <alpine.LNX.2.00.1102032121180.15101@swampdragon.chaosbits.net> (raw)

Hi,

In drivers/isdn/hisax/isdnl2.c:l2_pull_iqueue() we have this:

	...
		skb = alloc_skb(oskb->len + i, GFP_ATOMIC);
		memcpy(skb_put(skb, i), header, i);
	...

If alloc_skb() fails and returns NULL then the second line will cause a 
NULL pointer dereference - skb_put() gives the pointer to 
skb_tail_pointer() which dereferences it.

I'm not quite sure how this should be dealt with, so I'll just report it 
rather than submit a patch. Happy bug fixing :-)


-- 
Jesper Juhl <jj@chaosbits.net>            http://www.chaosbits.net/
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please.


             reply	other threads:[~2011-02-03 20:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-03 20:27 Jesper Juhl [this message]
2011-02-14  0:53 ` David Miller
2011-02-15 20:09   ` Milton Miller
2011-02-15 20:15     ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.00.1102032121180.15101@swampdragon.chaosbits.net \
    --to=jj@chaosbits.net \
    --cc=isdn@linux-pingi.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tj@kernel.org \
    --subject='Re: potential null pointer dereference in drivers/isdn/hisax/isdnl2.c' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).