From: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
To: Joe Perches <joe@perches.com>
Cc: David Miller <davem@davemloft.net>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] vsprintf: Prevent NULL dereference using %pNF
Date: Tue, 17 Jan 2012 22:12:15 +0100 [thread overview]
Message-ID: <20120117211215.GA18268@rere.qmqm.pl> (raw)
In-Reply-To: <1326829420.17202.21.camel@joe2Laptop>
On Tue, Jan 17, 2012 at 11:43:40AM -0800, Joe Perches wrote:
> On Tue, 2012-01-17 at 20:39 +0100, Michał Mirosław wrote:
> > On Tue, Jan 17, 2012 at 10:51:13AM -0800, Joe Perches wrote:
> > > On Tue, 2012-01-17 at 13:46 -0500, David Miller wrote:
> > > > From: Joe Perches <joe@perches.com>
> > > > Date: Tue, 17 Jan 2012 10:37:13 -0800
> > > > > Passing NULL to %pNF is done in skb_gso_segment
> > > > > which could be dereferenced.
> > > > skb_gso_segment() should be fixed instead.
> > > Maybe. Dereferencing NULL is bad form.
> > > Michał Mirosław should fix that as it's his patch.
> > Will do. This is in WARN() and easily fixed.
> >
> > > noinline_for_stack should be added anyway.
> >
> > Why? There are no local variables there and inlining this function would
> > actually save stack space as no stack frame would be created for the call.
> Isn't an additional copy of "struct printf_spec spec" on the stack
> in function pointer() now?
If the function is inlined then gcc should know that original is not needed
after call and do no copy. Without inlining, gcc should too, optimize it
because it's a tail call.
We could read the generated assembly to be sure, of course.
Best Regards,
Michał Mirosław
next prev parent reply other threads:[~2012-01-17 21:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-17 18:37 [PATCH] vsprintf: Prevent NULL dereference using %pNF Joe Perches
2012-01-17 18:46 ` David Miller
2012-01-17 18:51 ` Joe Perches
2012-01-17 18:52 ` David Miller
2012-01-17 18:54 ` Joe Perches
2012-01-17 18:59 ` David Miller
2012-01-17 19:39 ` Michał Mirosław
2012-01-17 19:43 ` Joe Perches
2012-01-17 21:12 ` Michał Mirosław [this message]
2012-01-18 2:43 ` Joe Perches
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=20120117211215.GA18268@rere.qmqm.pl \
--to=mirq-linux@rere.qmqm.pl \
--cc=davem@davemloft.net \
--cc=joe@perches.com \
--cc=linux-kernel@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