From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:35634 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754727AbeBWThy (ORCPT ); Fri, 23 Feb 2018 14:37:54 -0500 Date: Fri, 23 Feb 2018 20:37:37 +0100 From: Greg Kroah-Hartman To: Kees Cook Cc: "# 3.4.x" , Patrick McLean , "Maciej S. Szmigiero" Subject: Re: [PATCH 4.15,4.14] path.h: Include compiler types to avoid missed struct attributes Message-ID: <20180223193737.GA17341@kroah.com> References: <20180222233429.GA43713@beast> <20180223070804.GA19052@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: stable-owner@vger.kernel.org List-ID: On Fri, Feb 23, 2018 at 09:27:13AM -0800, Kees Cook wrote: > On Thu, Feb 22, 2018 at 11:08 PM, Greg Kroah-Hartman > wrote: > > On Thu, Feb 22, 2018 at 03:34:29PM -0800, Kees Cook wrote: > >> commit 28128c61e08eaeced9cc8ec0e6b5d677b5b94690 upstream. > >> > >> The header files for some structures could get included in such a way > >> that struct attributes (specifically __randomize_layout from path.h) would > >> be parsed as variable names instead of attributes. This could lead to > >> some instances of a structure being unrandomized, causing nasty GPFs, etc. > >> > >> This patch makes sure the compiler_types.h header is included in path.h. > >> > >> Reported-by: Patrick McLean > >> Root-caused-by: Maciej S. Szmigiero > >> Suggested-by: Linus Torvalds > >> Tested-by: Maciej S. Szmigiero > >> Fixes: 3859a271a003 ("randstruct: Mark various structs for randomization") > >> Signed-off-by: Kees Cook > >> Signed-off-by: Linus Torvalds > >> [kees: Adjusted to just path.h for -stable, as this is a smaller change] > >> Signed-off-by: Kees Cook > >> --- > >> This is a much more narrow fix for the issue. I adjusted the commit subject > >> and body, but still reference the "full" upstream commit. Is this the best > >> way to handle this? > > > > What's wrong with just taking the original upstream commit here? It's > > only 2 lines, in kconfig.h instead of path.h. What is the reason this > > has to be in path.h for 4.14.y and 4.15.y? > > I was (rightly) worried about unexpected build changes. If you'd > rather stick to upstream, we can do it. It'll just need at least one > fix so far: > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0f9da844d87796ac31b04e81ee95e155e9043132 > > Do you want me to just send those two? I can just take the git commits as-is, right? If not, a backport is always welcome :) thanks, greg k-h