lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 17 Jan 2012 22:12:15 +0100
From:	Michał Mirosław <mirq-linux@...e.qmqm.pl>
To:	Joe Perches <joe@...ches.com>
Cc:	David Miller <davem@...emloft.net>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] vsprintf: Prevent NULL dereference using %pNF

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@...ches.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ