From mboxrd@z Thu Jan 1 00:00:00 1970 Sender: Ingo Molnar Date: Thu, 5 Jul 2018 12:35:33 +0200 From: Ingo Molnar Subject: Re: [PATCH v13 (resend) 2/6] x86/entry: Add STACKLEAK erasing the kernel stack at the end of syscalls Message-ID: <20180705103533.GA16913@gmail.com> References: <1529686717-16017-1-git-send-email-alex.popov@linux.com> <1529686717-16017-3-git-send-email-alex.popov@linux.com> <20180705081236.GB20903@gmail.com> <20180705100003.GL2458@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180705100003.GL2458@hirez.programming.kicks-ass.net> To: Peter Zijlstra Cc: Alexander Popov , kernel-hardening@lists.openwall.com, Kees Cook , PaX Team , Brad Spengler , Andy Lutomirski , Tycho Andersen , Laura Abbott , Mark Rutland , Ard Biesheuvel , Borislav Petkov , Richard Sandiford , Thomas Gleixner , "H . Peter Anvin" , "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 , Steven Rostedt , Dominik Brodowski , Juergen Gross , Linus Torvalds , Greg Kroah-Hartman , Dan Williams , Dave Hansen , Mathias Krause , Vikas Shivappa , Kyle Huey , Dmitry Safonov , Will Deacon , Arnd Bergmann , Florian Weimer , Boris Lukashev , Andrey Konovalov , x86@kernel.org, linux-kernel@vger.kernel.org List-ID: * Peter Zijlstra wrote: > On Thu, Jul 05, 2018 at 10:12:37AM +0200, Ingo Molnar wrote: > > * Alexander Popov wrote: > > > +static inline void stackleak_task_init(struct task_struct *task) > > > +{ > > > +#ifdef CONFIG_GCC_PLUGIN_STACKLEAK > > > + task->lowest_stack = (unsigned long)end_of_stack(task) + > > > + sizeof(unsigned long); > > > +#endif > > > > Please don't break the line in such an ugly fashion - just keep the line long and > > ignore checkpatch, because the cure is worse than the disease. > > FWIW I don't totally hate on: > > task->lowest_stack = > (unsigned long)end_of_stack(task) + sizeof(unsigned long); > > which is a much more readable split. Yeah, or rename 'task' to the regular 't' or 'p' and do: t->lowest_stack = (long)end_of_stack(t) + sizeof(long); ;-) Ingo