Received: by 10.223.185.116 with SMTP id b49csp4190224wrg; Mon, 26 Feb 2018 12:53:01 -0800 (PST) X-Google-Smtp-Source: AH8x227PtvVm29skKDyaP629ARoaEKVJrt3VQh+KoYH+gupwnYXFPsrMvHBrY+XvprZWl354f8lG X-Received: by 10.98.69.146 with SMTP id n18mr11845841pfi.29.1519678381252; Mon, 26 Feb 2018 12:53:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519678381; cv=none; d=google.com; s=arc-20160816; b=nMjpMSZe+GYk7MxJ/ty/mlFtt33jGfOMcNTR41s/iu2VSVY7oQd+5Zu9JfIrLaqYEL sFPGygPLYDxBk7efbPaAKzT95NU0zTjS1HhXnyN1fieMLlgZsaDfB0yiGFx0khvNyZbo WdmgziXPrbYzWGs0PoMwy5y3/eKSvIDUboVUGDq5cNzVzStBdETlQAiwqncY/7eZ+Xck bY9gzsv8bpRR7g30mF2XhGUbc7eSjbLqezcMXCRb5KqAZ8/+rBB4V8GDgzjQFKsui0G0 7tUvvCLMJd0MSUVJcbulrpsoiGc4ER6sUl3qoBxwobnj3M8Atjl4Ae2LiuJcXJER6Foa C6XA== 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=OzFsR65ffzHt7To8tyOyFuuuyT36neiPijR28UKXoSM=; b=BlGaIXyUo/tfb773VLeHuakLeTfruvIdwmqYdh5FAoqRjob9YWD67KB4efCwXKUSRF d+woTK7x0zGwe2ETPRlN2ZdCs6fYrRu+vn8smyS9uX+9s5SJh3WTSfAC+0wSDCq58QIF t11Gc+mJKOQGUwl5167F/SMy0mpci2H8A6w3XR/zcvqTJviA81EnRjtDu5tG/wroPG7O ldm+/n8lPJb81g2X7SceT0jGslXABLqNkNjCWWxxOf2c25/qspcfJd3/Aj9y4NuNxFIn qUmQEDBdZ+Eo7i0KqcLQdTqvwHQ3oV6+mR5slNIRmPCJtLYRxe0N7RFjN0s1GjxORxk0 3DIw== 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 i2si5946293pgf.145.2018.02.26.12.52.45; Mon, 26 Feb 2018 12:53:01 -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 S1752894AbeBZUY1 (ORCPT + 99 others); Mon, 26 Feb 2018 15:24:27 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:35104 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752824AbeBZUYW (ORCPT ); Mon, 26 Feb 2018 15:24:22 -0500 Received: from localhost (clnet-b04-243.ikbnet.co.at [83.175.124.243]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 52900FA7; Mon, 26 Feb 2018 20:24:21 +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.14 03/54] kconfig.h: Include compiler types to avoid missed struct attributes Date: Mon, 26 Feb 2018 21:21:40 +0100 Message-Id: <20180226202144.541380019@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180226202144.375869933@linuxfoundation.org> References: <20180226202144.375869933@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.14-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 */