Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 6 Mar 2018 17:52:11 -0500
From: Steven Rostedt <>
To: Linus Torvalds <>
Cc: Arnd Bergmann <>, Ard Biesheuvel
 <>, Daniel Micay <>, Ingo
 Molnar <>, Kees Cook <>, Dave Hansen
 <>, Alexander Popov <>,
 Kernel Hardening <>, PaX Team
 <>, Brad Spengler <>, Andy
 Lutomirski <>, Tycho Andersen <>, Laura Abbott
 <>, Mark Rutland <>, Borislav Petkov
 <>, Richard Sandiford <>, Thomas
 Gleixner <>, "H . Peter Anvin" <>, Peter
 Zijlstra <>, "Dmitry V . Levin" <>,
 Emese Revfy <>, Jonathan Corbet <>, Andrey
 Ryabinin <>, "Kirill A . Shutemov"
 <>, Thomas Garnier <>,
 Andrew Morton <>, Alexei Starovoitov
 <>, Josef Bacik <>, Masami Hiramatsu
 <>, Nicholas Piggin <>, Al Viro
 <>, "David S . Miller" <>, Ding
 Tianhong <>, David Woodhouse <>,
 Josh Poimboeuf <>, Dominik Brodowski
 <>, Juergen Gross <>, Greg
 Kroah-Hartman <>, Dan Williams
 <>, Mathias Krause <>, Vikas
 Shivappa <>, Kyle Huey <>,
 Dmitry Safonov <>, Will Deacon <>,
 X86 ML <>, LKML <>
Subject: Re: [PATCH RFC v9 4/7] x86/entry: Erase kernel stack in

On Tue, 6 Mar 2018 14:41:55 -0800
Linus Torvalds <> wrote:

> I'm literally telling you that lack of variable initialization is
> almost purely a bad thing. C would be a safer language, with less
> undefined behavior, if it just made the initialization of automatic
> variables be something you cannot avoid.

I get your point. Basically you are saying that the language should
have forced all local variables to be initialized to zero in the spec,
and the compiler is free to optimize that initialization out if the
variable is always initialized first.

Just like it would optimize the below.

int g(int c)
	int i = 0;

	if (c < 10)
		i = 1;
		i = 2;
	return i;

There's no reason to initialize i to zero because it will never return
zero. But what you are saying is to make that implicit by just
declaring 'i'.

Other languages do this, and you are right, I don't expect warnings to
appear in  those. I guess I've grown so accustomed to this "undefined
behavior" it's part of what I just expect.

-- Steve

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.