Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4922d8fb3c334e76a622258bb3c610e6@AcuMS.aculab.com>
Date: Wed, 14 Mar 2018 11:35:26 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Kees Cook' <keescook@...omium.org>, Andrew Morton
	<akpm@...ux-foundation.org>
CC: Linus Torvalds <torvalds@...ux-foundation.org>, Linux Kernel Mailing List
	<linux-kernel@...r.kernel.org>, Josh Poimboeuf <jpoimboe@...hat.com>, "Rasmus
 Villemoes" <linux@...musvillemoes.dk>, "Gustavo A. R. Silva"
	<gustavo@...eddedor.com>, "Tobin C. Harding" <me@...in.cc>, Steven Rostedt
	<rostedt@...dmis.org>, Jonathan Corbet <corbet@....net>, Chris Mason
	<clm@...com>, Josef Bacik <jbacik@...com>, David Sterba <dsterba@...e.com>,
	"David S. Miller" <davem@...emloft.net>, Alexey Kuznetsov
	<kuznet@....inr.ac.ru>, Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>, "Ingo
 Molnar" <mingo@...nel.org>, Peter Zijlstra <peterz@...radead.org>, "Thomas
 Gleixner" <tglx@...utronix.de>, Masahiro Yamada
	<yamada.masahiro@...ionext.com>, Borislav Petkov <bp@...e.de>, Randy Dunlap
	<rdunlap@...radead.org>, Ian Abbott <abbotti@....co.uk>, Sergey Senozhatsky
	<sergey.senozhatsky.work@...il.com>, Petr Mladek <pmladek@...e.com>, "Andy
 Shevchenko" <andriy.shevchenko@...ux.intel.com>, Pantelis Antoniou
	<pantelis.antoniou@...sulko.com>, Linux Btrfs <linux-btrfs@...r.kernel.org>,
	Network Development <netdev@...r.kernel.org>, Kernel Hardening
	<kernel-hardening@...ts.openwall.com>
Subject: RE: [PATCH v3] kernel.h: Skip single-eval logic on literals in
 min()/max()

From: Kees Cook
> Sent: 13 March 2018 22:15
...
> I'll send a "const_max()" which will refuse to work on
> non-constant-values (so it doesn't get accidentally used on variables
> that could be exposed to double-evaluation), and will work for stack
> array declarations (to avoid the overly-sensitive -Wvla checks).

ISTR the definitions were of the form:
	char foo[max(sizeof (struct bah), sizeof (struct baz))];
This doesn't generate a 'foo' with the required alignment.
It would be much better to use a union.

	David

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.