From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1507C4332B for ; Thu, 4 Mar 2021 00:08:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A274E64F8A for ; Thu, 4 Mar 2021 00:08:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233368AbhCCX7y (ORCPT ); Wed, 3 Mar 2021 18:59:54 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:51441 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376802AbhCCTnb (ORCPT ); Wed, 3 Mar 2021 14:43:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614800525; 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=bv5cAMYlaP5qwIgoi2PUPPqfWwaPF9ayOOCbDPpLsEY=; b=UrcYyEEAWZvAzhhVKdMTad93zo3PxZL1U51d9kGwJuJhnGNfNX7+S4gaVVdxQd1260T8wy sN9iz2y00BXotgIQA6nMMDZsuS7TVS42zycrPX0qTfdWJMRtdA1ZXtSJ4OCUBD/9HCEiwW EHKNcQlGIxccEl4THTeCiifW86Hleo8= 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-104-3zO5FGdEPoyNzMkrsb1f9Q-1; Wed, 03 Mar 2021 14:38:18 -0500 X-MC-Unique: 3zO5FGdEPoyNzMkrsb1f9Q-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4457E10CE780; Wed, 3 Mar 2021 19:38:17 +0000 (UTC) Received: from treble (ovpn-114-218.rdu2.redhat.com [10.10.114.218]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EBD1518AD4; Wed, 3 Mar 2021 19:38:14 +0000 (UTC) Date: Wed, 3 Mar 2021 13:38:06 -0600 From: Josh Poimboeuf To: Linus Torvalds Cc: Masahiro Yamada , Linux Kernel Mailing List , Michal Marek , linux-hardening@vger.kernel.org, Linux Kbuild mailing list , Peter Zijlstra , Justin Forbes , Ondrej Mosnacek , Frank Eigler , Kees Cook Subject: Re: [PATCH RFC] gcc-plugins: Handle GCC version mismatch for OOT modules Message-ID: <20210303193806.oovupl4ubtkkyiih@treble> References: <20210302232649.y2tutffhxsblwqlb@treble> <20210303191516.6ksxmng4pis7ue4p@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.11 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 03, 2021 at 11:25:34AM -0800, Linus Torvalds wrote: > On Wed, Mar 3, 2021 at 11:15 AM Josh Poimboeuf wrote: > > > > Adding Linus, who indicated in another thread that we shouldn't force > > exact GCC versions because there's no technical reason to do so. > > I do not believe we should recompile everything just because the gcc > version changes. > > But gcc _plugins_ certainly should depend on the kernel version. > > Very few people should be enabling the gcc plugins in the first place. > Honestly, most of them are bad, and the people who really care about > those things have already moved to clang which does the important > parts natively without the need for a plugin. I'm personally waiting > for the day when we can just say "let's remove them". You might be sad to learn that some of the plugins are useful for hardening of a production distro kernel, like stackleak and structleak. > But in the meantime, making the plugins depend on the gcc version some > way is certainly better than not doing so. So currently, the plugins already so that. They require the GCC version to be exact. If there's a mismatch, then it fails the OOT module build. But that's not usable for a distro. When users build OOT modules with a slight GCC mismatch, it breaks the build, effectively requiring the exact same GCC version for *all* OOT builds going forward. So there have been a few proposals to better handle GCC version mismatches: 1) disable the plugin - this works fine for most plugins except randstruct 2) rebuild the plugin whenever the GCC version changes 3) fail the build, like today - effectively blocks distros from using plugins -- Josh