Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3367849pxb; Mon, 25 Jan 2021 14:13:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJyXscqOQ3xUxNmbMZt/Utapcjio/bJq9ox57aWLXyICDO5K5LJR670giuXPrxAZpgiaC1ja X-Received: by 2002:a05:6402:17a2:: with SMTP id j2mr2191423edy.15.1611612820167; Mon, 25 Jan 2021 14:13:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611612820; cv=none; d=google.com; s=arc-20160816; b=z1ngdSR7IouRSktc10WmcErLTYjUuC9vt36ImXJCVYZek+WW94A9OXowDkWSb+xn1p CFK7TQ8s7SrKU/bQizwO7srlCJmv7UultB26dHb0ofgYxnLlBfUchJfavO0hX7deW3f0 QYLPL8v7+A4lr63V+ViGJ/q7frYJeZXREn4TfuIh3jtbZIJzAYm1RQ6LxeTl7JjlRMzS AdjFPzJJ44Sxqqo5CRm5lmDtIVV/VJtBngbGZarjyV5ckPban1P0AIa9NJz3wzfi9UZu 3DB8yyNsKo4sNV23EiuPMOpsJqwJbx+NoAZoge3rM6vFA7LJtFjUHADNPsrRtEealNZ4 K99g== 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=YEfGCW9pOkAOxQjE9Kgiz1zr3syKfIZyR2H1zYGJuOs=; b=lsQe/AnvmRl0brMR2l0m0cD3w6sCKQ2G9FC0NIni/hdGmnBPnydK6iYlKhoNYgNzdz hnSMDZzY1dMjMvGHCT15iyi6tRPVe3hqaHGQ8SPmUU1+sDmLFdas0T4bcmYvupF9bZgW uXFAHl2QTBOToZ/7Wh+6II6r0CnskZ6l8zo07ngNh429s7FC/l4IwssJ9or3Hh7zOe/y oKi+3AmHyj3W0nwnnxu9xsLb2dotGnIFX28ngpcF8Fj/eo3CGF7ZUKvFqBcDtJs1St3G qtksfke7O/OeMHlPyXQ+xkZAyQEWJG2Yyt+EnGwtwNNHTyRo5qn1sPxmft2uDvy9fcPv Ortg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Xycli50Y; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f10si7842690edc.491.2021.01.25.14.13.14; Mon, 25 Jan 2021 14:13:40 -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=@redhat.com header.s=mimecast20190719 header.b=Xycli50Y; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732201AbhAYWLh (ORCPT + 99 others); Mon, 25 Jan 2021 17:11:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:45457 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731913AbhAYWJb (ORCPT ); Mon, 25 Jan 2021 17:09:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611612485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YEfGCW9pOkAOxQjE9Kgiz1zr3syKfIZyR2H1zYGJuOs=; b=Xycli50YhPe4pATq94uSlZegONdUOX79Nqy44Xg2jIc/8L6bLap654J7djZNkxB84XRwMH x+9+0iVHa1c7bV5vrWff/0J4DIZn2uBopmoENO61aen38JeRCGu/BxEZ+yVDU7ynR6QNvz WKZ3aKsa6d24331S2mnX/ut+ZwsoD8k= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-398-f-xxbEYqOyqco9IPcad1rA-1; Mon, 25 Jan 2021 17:08:03 -0500 X-MC-Unique: f-xxbEYqOyqco9IPcad1rA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C291218C8C00; Mon, 25 Jan 2021 22:08:01 +0000 (UTC) Received: from treble (ovpn-120-118.rdu2.redhat.com [10.10.120.118]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9F2276F978; Mon, 25 Jan 2021 22:08:00 +0000 (UTC) Date: Mon, 25 Jan 2021 16:07:57 -0600 From: Josh Poimboeuf To: Masahiro Yamada Cc: Kees Cook , Linux Kernel Mailing List , Michal Marek , linux-hardening@vger.kernel.org, Linux Kbuild mailing list , Peter Zijlstra , Justin Forbes , Ondrej Mosnacek Subject: Re: [PATCH RFC] gcc-plugins: Handle GCC version mismatch for OOT modules Message-ID: <20210125220757.vxdsf6sttpy46cq7@treble> References: <20210125212755.jfwlqogpcarmxdgt@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 26, 2021 at 06:44:35AM +0900, Masahiro Yamada wrote: > > > If people use a different compiler, they must be > > > prepared for any possible problem. > > > > > > Using different compiler flags for in-tree and out-of-tree > > > is even more dangerous. > > > > > > For example, CONFIG_GCC_PLUGIN_RANDSTRUCT is enabled > > > for in-tree build, and then disabled for out-of-tree modules, > > > the struct layout will mismatch, won't it? > > > > If you read the patch you'll notice that it handles that case, when it's > > caused by GCC mismatch. > > > > However, as alluded to in the [1] footnote, it doesn't handle the case > > where the OOT build system doesn't have gcc-plugin-devel installed. > > Then CONFIG_GCC_PLUGIN_RANDSTRUCT gets silently disabled and the build > > succeeds! That happens even without a GCC mismatch. > > > Ah, sorry. > > I responded too early before reading the patch fully. > > But, I do not like to make RANDSTRUCT a special case. > > I'd rather want to stop building for any plugin. Other than RANDSTRUCT there doesn't seem to be any problem with disabling them (and printing a warning) in the OOT build. Why not give users that option? It's harmless, and will make distro's (and their users') lives easier. Either GCC mismatch is ok, or it's not. Let's not half-enforce it. Also, how do you propose we solve the other problem, where a missing optional library (gcc-plugin-devel) causes the OOT module build to silently disable the plugin? This is related to my earlier complaint about the dangers of toolchain-dependent kconfig options. -- Josh