From: "Denis V. Lunev" <den-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
To: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Cc: Linux Containers
<containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org>,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
Alexey Dobriyan
<adobriyan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH 1/3] netns: Fix icmp shutdown.
Date: Fri, 20 Feb 2009 18:57:02 +0300 [thread overview]
Message-ID: <1235145422.9761.150.camel@iris.sw.ru> (raw)
In-Reply-To: <m1bpsxhzqz.fsf-+imSwln9KH6u2/kzUuoCbdi2O/JbrIOy@public.gmane.org>
Acked-by: Denis V. Lunev <den-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
On Fri, 2009-02-20 at 07:52 -0800, Eric W. Biederman wrote:
> Recently I had a kernel panic in icmp_send during a network namespace
> cleanup. There were packets in the arp queue that failed to be sent
> and we attempted to generate an ICMP host unreachable message, but
> failed because icmp_sk_exit had already been called.
>
> The network devices are removed from a network namespace and their
> arp queues are flushed before we do attempt to shutdown subsystems
> so this error should have been impossible.
>
> It turns out icmp_init is using register_pernet_device instead
> of register_pernet_subsys. Which resulted in icmp being shut down
> while we still had the possibility of packets in flight, making
> a nasty NULL pointer deference in interrupt context possible.
>
> Changing this to register_pernet_subsys fixes the problem in
> my testing.
>
> Signed-off-by: Eric W. Biederman <ebiederm-BGArkANP9klv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
> ---
> net/ipv4/icmp.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
> index 382800a..3f50807 100644
> --- a/net/ipv4/icmp.c
> +++ b/net/ipv4/icmp.c
> @@ -1207,7 +1207,7 @@ static struct pernet_operations __net_initdata icmp_sk_ops = {
>
> int __init icmp_init(void)
> {
> - return register_pernet_device(&icmp_sk_ops);
> + return register_pernet_subsys(&icmp_sk_ops);
> }
>
> EXPORT_SYMBOL(icmp_err_convert);
next prev parent reply other threads:[~2009-02-20 15:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-20 15:47 [PATCH 0/3] Fix Network namespace shutdown take 2 Eric W. Biederman
2009-02-20 15:52 ` [PATCH 1/3] netns: Fix icmp shutdown Eric W. Biederman
2009-02-20 15:53 ` [PATCH 2/3] tcp: Like icmp use register_pernet_subsys Eric W. Biederman
[not found] ` <m163j5hzow.fsf_-_-+imSwln9KH6u2/kzUuoCbdi2O/JbrIOy@public.gmane.org>
2009-02-20 15:57 ` Denis V. Lunev
2009-02-22 8:10 ` David Miller
2009-02-20 16:02 ` [PATCH 3/3] netns: Remove net_alive Eric W. Biederman
2009-02-22 8:11 ` David Miller
[not found] ` <m1bpsxhzqz.fsf-+imSwln9KH6u2/kzUuoCbdi2O/JbrIOy@public.gmane.org>
2009-02-20 15:57 ` Denis V. Lunev [this message]
2009-02-22 8:09 ` [PATCH 1/3] netns: Fix icmp shutdown David Miller
2009-02-25 12:43 ` [PATCH 0/3] Fix Network namespace shutdown take 2 Daniel Lezcano
2009-03-03 9:07 ` David Miller
2009-03-05 12:35 ` Daniel Lezcano
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=1235145422.9761.150.camel@iris.sw.ru \
--to=den-gefaqzzx7r8dnm+yrofe0a@public.gmane.org \
--cc=adobriyan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.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 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).