Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp533198pxb; Wed, 27 Jan 2021 14:08:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJztUE+MiAViFwkW4GQ/4Pvphg7P2jqIzEuaWmPsEsjENdykxUq1onFDMfwwJoZ63yd/NiSC X-Received: by 2002:a17:906:191b:: with SMTP id a27mr8536280eje.472.1611785323618; Wed, 27 Jan 2021 14:08:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611785323; cv=none; d=google.com; s=arc-20160816; b=BaVHmSFoC32GS5nd9rwQXRsiPx6vfjc5+o0h4R3Buq0otQ+kP1KknhYDSw8xeSAfxk IZTFa/IAD+BjyPwbUhFirWMGXiNn64Ah6a3PJUc4f2/TALlm5HR48EEiAoo+CNpDE2Wd 5RaUXjFdUwFg02W21HkDqvxERtYbqwps9aGPsGLHU5MSL9AyPHH1Citc7jWewBjMEGKh IQG02/utRpb9OcSGF5tlK4aGgMnCkFdRDpMghFr2nK/LKM279p1DTfNJYPGRhywS8ruE +UTcahxBLwDBfuTVpRpqweikpY0Q5IfBj+pvC3CgCFtYn5wusK94LdGWrYw/jhEKS9nu l6sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=v4vLMnE79I5H4BnynTTOoA+/hZLJz2auYrPML1aX3qo=; b=potX9YOmhUMhFzzdD0YIfXmZHMpICDKr/NvoG2bFwXMkYZ+WLqM0hwuVgkdyTNhKl4 fEZeiqKwaCjI045i3DjDJNhqcEi1U6VujPLTHEhlNkIg0/GYcHbXji2CJTucGL9W5Rw1 0aIlpeoaEY7HLE2VQMGJ7enMcb5uFqPuoNBjqkehX4545sYmO1RLdGBUTZRIL1KBLhH1 IhzkIxufEqV6FWEm7lDlPh+Imx3NMrlbd9jVaF3+lcNLKuH2Vp7Zzw1+vydB6uIsyloQ Y64tyd2DmVUDe947S8uia5JLhWC7i+acpVtzbervabiLCkmDRNRNvkXbTg3yxMrZBS+N 9hEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Y8/ezfvk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x12si1381831ejf.85.2021.01.27.14.08.18; Wed, 27 Jan 2021 14:08:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Y8/ezfvk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235878AbhA0K0b (ORCPT + 99 others); Wed, 27 Jan 2021 05:26:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S314201AbhAZXAj (ORCPT ); Tue, 26 Jan 2021 18:00:39 -0500 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F8E4C0613D6 for ; Tue, 26 Jan 2021 14:59:59 -0800 (PST) Received: by mail-pf1-x430.google.com with SMTP id m6so11385217pfk.1 for ; Tue, 26 Jan 2021 14:59:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=v4vLMnE79I5H4BnynTTOoA+/hZLJz2auYrPML1aX3qo=; b=Y8/ezfvkoAt+Zv1miXw4RTWhl+j87Mf7SfwiJlLpIBYP3EkeDaGdtkiq+c1+uOIImD sIpkEj2JvabE8/tJMIdj2Bs/sfcNrSumUuIQdHpvJeTZXf7G4xKB3GFUdKeBQ/dn3evm S9F3TMkc+7WC25HJeiKQJDMssxuJZ53Jpn9cQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=v4vLMnE79I5H4BnynTTOoA+/hZLJz2auYrPML1aX3qo=; b=smHM3FHZVOB4UijEswSrMf0YCrcvhjDY8EsPNMU5xpPC/ieN99bYyJd/TAbsxkdpf3 qw/aXLcIqolxmSYSeUkfxulXlQd3rxBCVf4GPKPculES2ZJVL+39a6IWBAudFgLaDkkF qme7/P+fm/hHnYbVgpi8e4aYLvBFFmRHBMt3t8yG8pkE8y4dKF5eY9lNX1ahkc6DZG4t bgL9Gfbz/GyB7vy3Q2cHazpmqvxD0XfgwEqQh5fdCqiUhDwUs5Wm7dfE3SRe2KsbafGu TzjjCDi0t65XCkcWwh0AYhc9WNUJFcaAOHvZpQ294c0crRbfGd2986L6rM07COdy38Ri 7qXA== X-Gm-Message-State: AOAM531umKSuw1o+5GvoJTx4K+46qdK2VDA3QoDcVpihhi6ou6rq1K51 AskMJPgz0PdBRV5oLZzSsyyvTg== X-Received: by 2002:aa7:9a48:0:b029:1b7:bb17:38c9 with SMTP id x8-20020aa79a480000b02901b7bb1738c9mr7461264pfj.51.1611701999000; Tue, 26 Jan 2021 14:59:59 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id w20sm61139pga.90.2021.01.26.14.59.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jan 2021 14:59:58 -0800 (PST) Date: Tue, 26 Jan 2021 14:59:57 -0800 From: Kees Cook To: Josh Poimboeuf Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Michal Marek , linux-hardening@vger.kernel.org, linux-kbuild@vger.kernel.org, Peter Zijlstra , Justin Forbes , Ondrej Mosnacek Subject: Re: [PATCH RFC] gcc-plugins: Handle GCC version mismatch for OOT modules Message-ID: <202101261459.C90E9F97D@keescook> References: <202101251401.F18409FDD1@keescook> <20210125221953.wng3gk3qc32eahil@treble> <202101260955.F83D191B@keescook> <20210126184316.hpcy6gqp5vsq6ckq@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210126184316.hpcy6gqp5vsq6ckq@treble> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 26, 2021 at 12:43:16PM -0600, Josh Poimboeuf wrote: > On Tue, Jan 26, 2021 at 09:56:10AM -0800, Kees Cook wrote: > > On Mon, Jan 25, 2021 at 04:19:53PM -0600, Josh Poimboeuf wrote: > > > On Mon, Jan 25, 2021 at 02:03:07PM -0800, Kees Cook wrote: > > > > On Mon, Jan 25, 2021 at 02:42:10PM -0600, Josh Poimboeuf wrote: > > > > > When a GCC version mismatch is detected, print a warning and disable the > > > > > plugin. The only exception is the RANDSTRUCT plugin which needs all > > > > > code to see the same struct layouts. In that case print an error. > > > > > > > > I prefer this patch as-is: only randstruct needs a hard failure. The > > > > others likely work (in fact, randstruct likely works too). > > > > > > I'm curious about this last statement, why would randstruct likely work? > > > > > > Even struct module has '__randomize_layout', wouldn't basic module init > > > go splat? > > > > No; the seed is part of the generate includes -- you'll get the same > > layout with the same seed. > > Right, but don't you need the plugin enabled to make use of that seed, > so the structs get interpreted properly by the module? Or am I > completely misunderstanding how this plugin works? Having the plugin enabled or not is part of the Kconfig ... you can't build anything if you change Kconfig. I feel like I'm missing something... -- Kees Cook