netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: kaber@trash.net
Cc: akpm@osdl.org, mita@miraclelinux.com,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] fix use after free in netlink_kernel_create()
Date: Sun, 13 Aug 2006 21:02:02 -0700 (PDT)	[thread overview]
Message-ID: <20060813.210202.127668846.davem@davemloft.net> (raw)
In-Reply-To: <44DF7422.2090904@trash.net>

From: Patrick McHardy <kaber@trash.net>
Date: Sun, 13 Aug 2006 20:49:06 +0200

> Andrew Morton wrote:
> > On Sun, 13 Aug 2006 13:52:58 +0200
> > Patrick McHardy <kaber@trash.net> wrote:
> > 
> >>Quite a few users of netlink_kernel_create will panic when creating
> >>the socket fails (rtnetlink for example, which is always present),
> >>so you might as well call panic here directly.
> > 
> > 
> > That's a bit lame.  Panicing at do_initcalls() time is OK (something is
> > seriously screwed anyway) but we usually try to handle the ENOMEM nicely if
> > it happens at modprobe-time.
> 
> The users I looked at can't be built as modules (rtnetlink, genetlink,
> audit subsystem), I'm not aware of any modules panicing on
> netlink_kernel_create failure. But all of netlink, genetlink and
> rtnetlink are always built-in when CONFIG_NET=y, so we might as well
> panic here.

Agreed.

netlink_proto_init() is a core_initcall(), we are pretty much in
an irrecoverable bind if that thing fails, so panic() is appropriate
here.


      reply	other threads:[~2006-08-14  4:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-13 10:15 [PATCH] fix use after free in netlink_kernel_create() Akinobu Mita
2006-08-13 11:52 ` Patrick McHardy
2006-08-13 17:44   ` Andrew Morton
2006-08-13 18:49     ` Patrick McHardy
2006-08-14  4:02       ` David Miller [this message]

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=20060813.210202.127668846.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=akpm@osdl.org \
    --cc=kaber@trash.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mita@miraclelinux.com \
    --cc=netdev@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 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).