From: <gregkh@suse.de>
To: ebiederm@xmission.com,davem@davemloft.net,gregkh@suse.de,levinsasha928@gmail.com
Cc: <stable@vger.kernel.org>, <stable-commits@vger.kernel.org>
Subject: Patch "netns: Fail conspicously if someone uses net_generic at an inappropriate time." has been added to the 3.0-stable tree
Date: Tue, 31 Jan 2012 11:46:30 -0800 [thread overview]
Message-ID: <13280391901597@kroah.org> (raw)
This is a note to let you know that I've just added the patch titled
netns: Fail conspicously if someone uses net_generic at an inappropriate time.
to the 3.0-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
netns-fail-conspicously-if-someone-uses-net_generic-at-an-inappropriate-time.patch
and it can be found in the queue-3.0 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 5a05ab92ada965456811637347939e181cb55adc Mon Sep 17 00:00:00 2001
From: "Eric W. Biederman" <ebiederm@xmission.com>
Date: Thu, 26 Jan 2012 14:02:55 +0000
Subject: netns: Fail conspicously if someone uses net_generic at an inappropriate time.
From: "Eric W. Biederman" <ebiederm@xmission.com>
[ Upstream commit 5ee4433efe99b9f39f6eff5052a177bbcfe72cea ]
By definition net_generic should never be called when it can return
NULL. Fail conspicously with a BUG_ON to make it clear when people mess
up that a NULL return should never happen.
Recently there was a bug in the CAIF subsystem where it was registered
with register_pernet_device instead of register_pernet_subsys. It was
erroneously concluded that net_generic could validly return NULL and
that net_assign_generic was buggy (when it was just inefficient).
Hopefully this BUG_ON will prevent people to coming to similar erroneous
conclusions in the futrue.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Tested-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
include/net/netns/generic.h | 1 +
1 file changed, 1 insertion(+)
--- a/include/net/netns/generic.h
+++ b/include/net/netns/generic.h
@@ -41,6 +41,7 @@ static inline void *net_generic(const st
ptr = ng->ptr[id - 1];
rcu_read_unlock();
+ BUG_ON(!ptr);
return ptr;
}
#endif
Patches currently in stable-queue which might be from ebiederm@xmission.com are
queue-3.0/usb-io_ti-make-edge_remove_sysfs_attrs-the-port_remove-method.patch
queue-3.0/net-caif-register-properly-as-a-pernet-subsystem.patch
queue-3.0/netns-fix-net_alloc_generic.patch
queue-3.0/netns-fail-conspicously-if-someone-uses-net_generic-at-an-inappropriate-time.patch
reply other threads:[~2012-01-31 19:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=13280391901597@kroah.org \
--to=gregkh@suse.de \
--cc=davem@davemloft.net \
--cc=ebiederm@xmission.com \
--cc=levinsasha928@gmail.com \
--cc=stable-commits@vger.kernel.org \
--cc=stable@vger.kernel.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.