From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AG47ELvfrW+7gL9gs7ozNueFs3zG88K/kC0c2286u2dtd+86sEuuYZ5aOXthCbrEfWDcWpdioR4J ARC-Seal: i=1; a=rsa-sha256; t=1520375371; cv=none; d=google.com; s=arc-20160816; b=T25imwAeuE3fKkYemyItDFLI1nFQhlh9ZmaQ1Xird0+L0ZErzI3xB2GlQsv2rmV2NU qwOprM8hgyvVJxuck+oZv9x7UsN8MPWqasSoFzuSz5zhGHV+9/PT99t0PSyA7rMKoBGE ryj8hfnZHcMhwCNEzSvfS3RPjINmzw1jfuZgi1UWfcNeJTnEERl9JMH7rXiyD40W7Euo KXhkRrRFPWk+1PuX1c0DYZ8TTTGI8GMw1GTwmtTmiqIqXY0DHLccAAIgXlfox8M3YrOe 8Ng7Sn1vMv3oYZnbza2G+zJKkev2i4WqaQVOKhKrixtzS1EtLtnpeCIDa2ML810MoVEY FZ+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:dmarc-filter :arc-authentication-results; bh=7DnvlSAiDfgI9wd/2kK5J36f91oo5Nebz4x4kPImtQ8=; b=F/KriQW+LfZ22G1pE1KAqkj2WTUovrdaCNv+0melZ3ccXVrfZYPPviNzY8EkyOIjzm syQLFKJHGWK6mzJTtejITKrVDYk2dmLij/nWuVIvsywijaiHpPKNWjhd3/m+NXKXioo1 E9CLM4tQT1CoHnl59WWP87EsBExILjPeLGx7pJbCwcR/VpwiV7qOU2MK/D6xSCruh0Ky Z0ZIfiCs+cZWQtXOmDWzeSBOE7i0UsinLJEc9FrIqNQfMXG/ibp5sbsrP0tir6kqhuoh OaLdPWqQovQSzASsvOYzr2fFa+UH0wY3qh3l2s4+l46sAC+KT2yUVWpfDESvYER1/DBI z9+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of srs0=tol7=f4=goodmis.org=rostedt@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=SRS0=toL7=F4=goodmis.org=rostedt@kernel.org Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of srs0=tol7=f4=goodmis.org=rostedt@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=SRS0=toL7=F4=goodmis.org=rostedt@kernel.org DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7408121795 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Tue, 6 Mar 2018 17:29:27 -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 syscall_trace_enter() Message-ID: <20180306172927.7a975cee@vmware.local.home> In-Reply-To: References: <1520107232-14111-1-git-send-email-alex.popov@linux.com> <20180306080855.phtgl2bzqm5hnthu@gmail.com> <20180306163616.7e3b6e0e@vmware.local.home> X-Mailer: Claws Mail 3.15.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1593947986518331727?= X-GMAIL-MSGID: =?utf-8?q?1594229125436712694?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: On Tue, 6 Mar 2018 13:47:11 -0800 Linus Torvalds wrote: > But that's no different from "static variables initialize to zero" and > nobody sane expects a warning from that. It's just what it is. Yeah but I would argue that static variables are different. They are either used in multiple functions or are used for the same function that maintains its value for multiple calls to that function. Either way the semantics of a static variable is that it has to be initialized to something, because you don't know when the first one sets it. Local variables on the other hand are only in scope of one logical function algorithm. I've done lots of stupid errors where I may initialize a local variable in a loop and forget that the loop may never execute. Sometimes the original value shouldn't be zero, although most times it is. But that warning has saved me, especially when the value isn't supposed to be zero. -- Steve