All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: torvalds@linux-foundation.org
Cc: johannes@sipsolutions.net, linville@tuxdriver.com,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: nl80211 NULL pointer dereference
Date: Wed, 19 Jun 2013 00:47:11 -0700 (PDT)	[thread overview]
Message-ID: <20130619.004711.1012726896714145860.davem@davemloft.net> (raw)
In-Reply-To: <CA+55aFz=eG5-zh1toHxrx=4Qm4DvwyiBCU3u-6tc0-utfZ6xiA@mail.gmail.com>

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: Tue, 18 Jun 2013 16:24:57 -1000

> And yes, the code checks that for being non-NULL in at the top of the
> function, but maybe there is a race with something else setting it to
> NULL? There is a kzalloc(GFP_KERNEL) in between, so it doesn't even
> have to be a very small race...

The nl80211 code uses a flag for each netlink command to determine
whether the RTNL mutex should be held across the operation.

This is handled in the pre_doit and post_doit methods implemented
in nl80211.c.

And this operation, in fact, just so happens to be one that doesn't
have the "take the RTNL mutex" flag set.

But for internal consistency of the netlink message itself, the RTNL
mutex should not matter.  It's in a private SKB buffer which is in use
only by the ->doit() method.


  reply	other threads:[~2013-06-19  7:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-19  1:46 nl80211 NULL pointer dereference Linus Torvalds
2013-06-19  2:06 ` David Miller
2013-06-19  2:06   ` David Miller
2013-06-19  2:24   ` Linus Torvalds
2013-06-19  2:24     ` Linus Torvalds
2013-06-19  7:47     ` David Miller [this message]
2013-06-19  7:54     ` Johannes Berg
2013-06-19  8:23       ` [PATCH] nl80211: fix attrbuf access race by allocating a separate one Johannes Berg
2013-06-19  8:39         ` David Miller
2013-06-19 13:51           ` John W. Linville
2013-06-19 13:51             ` John W. Linville
2013-06-19 13:44         ` Sergei Shtylyov
2013-06-19 16:26         ` Linus Torvalds
2013-06-19 16:57         ` Ben Greear
2013-06-19 17:00           ` Johannes Berg
2013-06-19 17:04             ` Ben Greear

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=20130619.004711.1012726896714145860.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.