Received: by 10.223.185.116 with SMTP id b49csp4181550wrg; Mon, 26 Feb 2018 12:42:05 -0800 (PST) X-Google-Smtp-Source: AG47ELuPTWvlCpQk/SIXFIvJAF8XsbJZdS3Z1k1FzUJEttwVp4Dschq6U3Nf6qEcUo5flT+2tdIq X-Received: by 2002:a17:902:4001:: with SMTP id b1-v6mr3380936pld.28.1519677725203; Mon, 26 Feb 2018 12:42:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519677725; cv=none; d=google.com; s=arc-20160816; b=alC+KfT8itnxLE8v1+Lic5cSoZyWQ8ns6/dtflo0t9wp6n9ogAELz7nLxLKRn+A+hI oVjepEV18VTGxWpxbv5r0RuKZDBj2WcXi59oQlDhkbYySBJrTDhP0KM0zwipoPU79jCn 9NFtOGD3DIrVwdCV/gl8dJNISlq/2+/wgtt0Vq1Od86UOBHzbzgL1YuiYO+bfjwUgmOv ur2P6q5xcKSDR1suKpDalkQsHad8djAFB8fxGoGvPF/hSJPVZnBltfv8Cf6RHHSX/K2t ZBm7bXMud1oy7Pi8i6+cHRJUFm/hwOxxln5xNtrVyPHDQX1mLLqj0KpgZcO48YWojpRc zTRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=fxtWk2YGvzJNfOERnRgVP7xH2zLm89/51Ht4LxQTMjo=; b=ErklfbK1kWZPrBAljhOHg3RgIZUH96EGNp8DmCOU4G9J6H3NauJXnlZrWjbMjl80+V DKmHYNstRntAw5IuKTNTx9DIOtQJPoE4523V7hCqKGfYg8yzuILz2QAybBhvnkP6NEeW vwH0mFvJhT31/wkAEKLpcefjeZOl9lDz3T2vX94DZoCyWfpTb8+MJdAXaw7+UJrLZ2Ix hNxMz9d02ciQniQfVZaBqBq9skvvnPDZ3uUc0u8Oiv2tCINw8vd1sX3/+sZLPAAFacGv aAitfe8E5q3MIm+JfDKRDUzf+hwhCWQ4zCSvT9F7xjN4RXssq4eMpQU+9XBd5zh4YxDL pcOw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u19si5902403pgv.195.2018.02.26.12.41.48; Mon, 26 Feb 2018 12:42:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753570AbeBZUkW (ORCPT + 99 others); Mon, 26 Feb 2018 15:40:22 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:36402 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753629AbeBZU1L (ORCPT ); Mon, 26 Feb 2018 15:27:11 -0500 Received: from localhost (clnet-b04-243.ikbnet.co.at [83.175.124.243]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 81B809DA; Mon, 26 Feb 2018 20:27:10 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Patrick McLean , Linus Torvalds , "Maciej S. Szmigiero" , Kees Cook Subject: [PATCH 4.15 03/64] kconfig.h: Include compiler types to avoid missed struct attributes Date: Mon, 26 Feb 2018 21:21:40 +0100 Message-Id: <20180226202153.589811845@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180226202153.453363333@linuxfoundation.org> References: <20180226202153.453363333@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kees Cook 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 kconfig.h so that we've always got types and struct attributes defined, since kconfig.h is included from the compiler command line. 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 Signed-off-by: Greg Kroah-Hartman --- include/linux/kconfig.h | 3 +++ 1 file changed, 3 insertions(+) --- a/include/linux/kconfig.h +++ b/include/linux/kconfig.h @@ -64,4 +64,7 @@ */ #define IS_ENABLED(option) __or(IS_BUILTIN(option), IS_MODULE(option)) +/* Make sure we always have all types and struct attributes defined. */ +#include + #endif /* __LINUX_KCONFIG_H */