Received: by 10.223.185.116 with SMTP id b49csp2085436wrg; Thu, 22 Feb 2018 07:58:13 -0800 (PST) X-Google-Smtp-Source: AH8x226a5AR78Rh1WZClyBRh7KbXkJEhk2tiMIOMFJnCVQw6TOUmumJfPcjGF6+sCZY/a3d0mnAS X-Received: by 10.99.64.197 with SMTP id n188mr6036041pga.21.1519315093314; Thu, 22 Feb 2018 07:58:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519315093; cv=none; d=google.com; s=arc-20160816; b=rqBwtyUvVRDRan60T5Nm5x3RkVxc429ynTSSZX9daw6+SBXdqMkqJtAdMHBM39n0QI NMIoddYeBpMUCvx52qJ/BcPulspth3naiUvaThYsNY8UA7/2y8c+kSE0tHqhNmjeeHCz xDVHiK+TAlyPr7q0FwoByeyRwhRKi4e1MivbtBTJw94Xh0ZgU6kMPAs1N4yPB3J0ZINh +XQSE36Ziz0g4qZCLVMAJ2ofCoOfLzMf5QB23n0uJmPK1WfIvUUCxwM/xIPPAHGL+73e PZsd6HruDLTsY5pXhEXnqfbCc1D4AdvZOWCVOhmnLGwWhnaigGOe9vLL6IA9hTfwGu3u /dGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=Y9yc1pUZpp7Bj/Zrns7zFpmWUayVyfrnAT+syMSDrEo=; b=Oeio0biYkwCMXETJtALxoSP7SmNh8htbfnyEXSNAIAIr94eIUXcON4HUXwRcFDrkoo ZJ3BxsNdWYvcEI3x5TGesltH1ulN2fPBKAYjvNizMRU3tMHklsVIr97GgrOJmjnxjH1P 0AJIS2+5mkyY42F/64PiCkhOHRXUeX9R+XcQ3ExeHKRYTBlw0mxGmaq4LTtaSbC2y+8+ 1CuOttQvohtuU5BJGVDLF2j36EzVtCUsK8J30X5usy3++mfWBBe++r6PHPJNrmfLIz0H 9N3vgGZbCLZMPUfTOhRFXX8cpvtW9xumjIcq9mKNuSHXQmGTdwFCj7LWt9XX/P3lI8c+ i19Q== 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 z3si181670pgb.805.2018.02.22.07.57.58; Thu, 22 Feb 2018 07:58:13 -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 S933134AbeBVP5B (ORCPT + 99 others); Thu, 22 Feb 2018 10:57:01 -0500 Received: from vps-vb.mhejs.net ([37.28.154.113]:58738 "EHLO vps-vb.mhejs.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932952AbeBVP5A (ORCPT ); Thu, 22 Feb 2018 10:57:00 -0500 Received: by vps-vb.mhejs.net with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89) (envelope-from ) id 1eotEv-0007t1-FF; Thu, 22 Feb 2018 16:56:57 +0100 Subject: Re: [PATCH v2] kconfig.h: Include compiler types to avoid missed struct attributes To: Kees Cook Cc: Linus Torvalds , Patrick McLean , linux-kernel@vger.kernel.org References: <20180222002854.GA29269@beast> From: "Maciej S. Szmigiero" Message-ID: <36583adc-9c01-fd21-074a-e3df2cbb3dee@maciej.szmigiero.name> Date: Thu, 22 Feb 2018 16:56:56 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180222002854.GA29269@beast> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22.02.2018 01:28, Kees Cook wrote: > 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 > Fixes: 3859a271a003 ("randstruct: Mark various structs for randomization") > Suggested-by: Linus Torvalds > Signed-off-by: Kees Cook I can confirm that this patch fixes the original nfsd GPF issue. Also, struct path members offsets are consistent now between nfs4xdr.s and other files. > --- > Updated Maciej's tag. Thanks. Maciej