Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2276489ioo; Mon, 23 May 2022 14:36:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygmDqDDEC9FU7VjUOOa8J3ZO3/tykjmq52N+UZXumqq29psuRlgaooHLITAAihJ3s4LxXj X-Received: by 2002:a17:902:d544:b0:161:c3fc:5de5 with SMTP id z4-20020a170902d54400b00161c3fc5de5mr24854925plf.112.1653341783491; Mon, 23 May 2022 14:36:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653341783; cv=none; d=google.com; s=arc-20160816; b=pRI84uIHNUYDtBWbuL8MhGyxJVlUpS0mZcdsWR/1+dn5GsgnTmOkyF/dPE+0YpA77U AomNXbW4PiuMiTUcRF4v6286K7RE1FWnMlx/LFhhHZ/NwFGs2eg0cI6IAT2FeNae5AIB 3CIa3tmKfDgQXpEQpOwZAOVOvenwkfGP94Hzu9f2UZjjjjFVTqEEcvIDkRcfV3nmA2Dr TAVoSPID5YAhBnQvhCJqxDMpe1i0qcE6LTk9beRTZlV1c5XR8OBySNurY20IEkljKJiS WY79e8++wIKNDSR8jfE6PnmZw1ql3kHqYYAKOyjjM9IYpt5Udk6Gequ0ULYKTfzy/Qyl 1NMg== 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=O4+xOyqn0DlQXpBjw3fsuM8J9adeD3sXmNoLX1130DM=; b=e957aQ9KDnbl30RcLQI/C1jqAST8+VzobziLvmQCCILnJJGaJnDgqEmol/+IxjkbuS WwSL9c0ROkvSHmamrt0COvyHu7KUKoFlZJF8v8OYYvJjuSNufcaZaeOqvF44dG6mgV2g NNxo7+RZJ0E3wKQ9E0kTTTR5oLkKVKrhP4Xyn/0ooWXx/HDR4K5Wg8gV0jSfaE01hRny yL9FbsSUrx3nSacBQOwPu8tPI2VbAr9GVfEt6I2nyhsc1afoXXiAI/9gbkEXUquQXdjF SRUXY8C8kbW8nwjJMAVDJhXTb3QT0ulRQOhKjw0o80lRUDabqWytsUmG/oCxRKgP0Tol /+Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VDNuzx6f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 135-20020a63028d000000b003fa7e315240si3349471pgc.249.2022.05.23.14.36.12; Mon, 23 May 2022 14:36:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VDNuzx6f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231817AbiEWTyQ (ORCPT + 99 others); Mon, 23 May 2022 15:54:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229783AbiEWTyO (ORCPT ); Mon, 23 May 2022 15:54:14 -0400 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A8D46D944 for ; Mon, 23 May 2022 12:54:10 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id n18so14024438plg.5 for ; Mon, 23 May 2022 12:54:10 -0700 (PDT) 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=O4+xOyqn0DlQXpBjw3fsuM8J9adeD3sXmNoLX1130DM=; b=VDNuzx6fJMXmw8XNqCUtAVCF02j4OmsqvvTf5vsnBCotQDMHYtj33uCT5ocfpE3D8B cnNLiyFE6mRLGz2/sdfOx1lpRXuJuSayIu45co+2FJj1Fw3D9/ri37qdcaEXMk1SEOuz 7Ihg2BhmblaAFoDBviQBO+f2O9yMZrE5akEzE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=O4+xOyqn0DlQXpBjw3fsuM8J9adeD3sXmNoLX1130DM=; b=Kjtw78DHWdeiZrL/OLiWY+NS0KwiNxU3dTshoCTqtkHaN9BmMuwYnSEPksOhfkpsWb nMeyGUZiWJnNOCVma/LI/W4ftv7ecNfbcxHKmYqN/U1ImvFiNAvazNyo6Mz8z0Q95B2q 2rZK9XYnOjm4dGy4vCg9oLfZvpEM1ng7whGVtaQ4HXk9ihSW7a8bF7vKJSrJvpNdqjpX AGQllyw/h0HZfWoigv2aNIcdKZPDwB1n1Ph6aqJ56mM7zS5Jchvns6/8V0stOCJJ8LJH gbXzF+ASf49b4ZJfkqCB3E/PdLhwR+x+ZqM8ursZ0Bi+htZBmtTsS7JNPobFCt5AO4Xu NBpQ== X-Gm-Message-State: AOAM532R7IFqQf9cpiyBP8ItZtnnVENHoPmd7cMlTczNDO47sL8Dgaw6 4e1HeI6VK9qzeNViyT8o+uQ6gA== X-Received: by 2002:a17:90a:aa8a:b0:1c9:bfd8:9a90 with SMTP id l10-20020a17090aaa8a00b001c9bfd89a90mr650355pjq.118.1653335649635; Mon, 23 May 2022 12:54:09 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id q9-20020a170902f78900b0015e8d4eb292sm3534189pln.220.2022.05.23.12.54.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 12:54:09 -0700 (PDT) Date: Mon, 23 May 2022 12:54:06 -0700 From: Kees Cook To: Guenter Roeck Cc: Alexander Popov , linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, Masahiro Yamada , linux-kbuild@vger.kernel.org Subject: Re: [PATCH] gcc-plugins: Change all version strings match kernel Message-ID: <202205231251.39D012E@keescook> References: <20220510235412.3627034-1-keescook@chromium.org> <20220523143054.GA3164771@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220523143054.GA3164771@roeck-us.net> X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 23, 2022 at 07:30:54AM -0700, Guenter Roeck wrote: > On Tue, May 10, 2022 at 04:54:12PM -0700, Kees Cook wrote: > > It's not meaningful for the GCC plugins to track their versions separately > > from the rest of the kernel. Switch all versions to the kernel version. > > > > Fix mismatched indenting while we're at it. > > > > Cc: linux-hardening@vger.kernel.org > > Signed-off-by: Kees Cook > > I see random build failures with this patch in linux-next. > > Error log: > cc1plus: fatal error: ./include/generated/utsrelease.h: No such file or directory > > The problem doesn't happen all the time. Is there some missing dependency ? Here's a prior report I hadn't been able to repro: https://lore.kernel.org/linux-mm/202205230239.EZxeZ3Fv-lkp@intel.com But now I can: I see it with a -j1 build. This fixes it for me: diff --git a/Makefile b/Makefile index 91c91fcf3c24..c04420d5aa3d 100644 --- a/Makefile +++ b/Makefile @@ -1175,7 +1175,7 @@ include/config/kernel.release: FORCE # Carefully list dependencies so we do not try to build scripts twice # in parallel PHONY += scripts -scripts: scripts_basic scripts_dtc +scripts: include/generated/utsrelease.h scripts_basic scripts_dtc $(Q)$(MAKE) $(build)=$(@) # Things we need to do before we recursively start building the kernel diff --git a/scripts/gcc-plugins/Makefile b/scripts/gcc-plugins/Makefile index 6f0aecad5d67..c29334669a16 100644 --- a/scripts/gcc-plugins/Makefile +++ b/scripts/gcc-plugins/Makefile @@ -64,5 +64,5 @@ $(foreach m, $(notdir $(plugin-multi)), $(eval $(obj)/$m: $(addprefix $(obj)/, $ quiet_cmd_plugin_cxx_o_c = HOSTCXX $@ cmd_plugin_cxx_o_c = $(HOSTCXX) $(plugin_cxxflags) -c -o $@ $< -$(plugin-objs): $(obj)/%.o: $(src)/%.c FORCE +$(plugin-objs): $(obj)/%.o: $(src)/%.c $(objdir)/include/generated/utsrelease.h FORCE $(call if_changed_dep,plugin_cxx_o_c) Both "include/generated/utsrelease.h" and "scripts" were same-level deps, so they were racing. -- Kees Cook