Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2159325iof; Tue, 7 Jun 2022 21:44:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygyrwn4S0+hZ7TqwYIm0iJcUsXDX20dv6Mkj9QtB+eRiCqnmcsl64SiUQKTHY/NssF8YT+ X-Received: by 2002:a17:902:e84c:b0:167:6ef7:b09b with SMTP id t12-20020a170902e84c00b001676ef7b09bmr16776075plg.43.1654663445844; Tue, 07 Jun 2022 21:44:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654663445; cv=none; d=google.com; s=arc-20160816; b=nTGsfdAwlIVVXy+UZXFA5i2BQ6sAaWoVNsvB+jEfBR3fARt6s7B4+kWQKAevVKgEWS gQv6MCsd6xiWSl8kfZPTcD033+quUJVYa8/uqJdIi3vKOlQVC4+r9Rlqg+i+g/j6Cidb g7xyTlXLxrjV8uc2R2ubEUhv7qq8G8fwlwL1ff5zNoif4fyDEBOTMMHQTretlq9oJAcx v4KG2BGsIggSuGTJxbSeMSnK/Ts8PKnuKjnQP8jQyLI2RiIJ6usWXZGC2do9jR5gh6lK Z/4kvKxh+7yvh9x9vEHS6SoOa1MnK6KGQJO8pRMTNF/2MHxkiqlNXgeNaZKmfsbINZM5 d1Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wNW3rWbFFERWRw8+ROptBBcFUYcRGb5mtiYoFKbeSfs=; b=peI1OIaOeTrJGJiyd9/XcGtOhlzG0s3171EC8F6faCRDkuxbOm/iWo58Q+vfSwYo5p VDbtT4BUtqqP8zhj8AnXbSgSz26DIY92yNA3AkSkbUeJmG5zTK/ReeU9At74Q+47C0WA f2GcQHntJe9g6bISQd6SPNjm+tLKtgwK6mv4/POcNOs6Vn47Q/j7YDYlm4/jYOZyv5IT fbFP0w/BUMiEGbEQo/HgBEvIIW8OcVYmi9lWQUiLNn3X6O1mormYKLILyyr9S7nrSQ/z S0h11Y6biF188gX7ORsVsfwz1cJEOjWATd/3m7xoEEpyOubmY+NNrNSZB5Mzb99WIRCV 26ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Mi8uqq72; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id p17-20020a056a000b5100b004fae70007c5si27732733pfo.78.2022.06.07.21.44.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:44:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Mi8uqq72; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 93B952C5DB4; Tue, 7 Jun 2022 21:13:40 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1385192AbiFGWph (ORCPT + 99 others); Tue, 7 Jun 2022 18:45:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352049AbiFGVcp (ORCPT ); Tue, 7 Jun 2022 17:32:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FF5A17A88B; Tue, 7 Jun 2022 12:04:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1936661787; Tue, 7 Jun 2022 19:04:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23E9BC385A5; Tue, 7 Jun 2022 19:04:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628653; bh=z738e8BO/UJzm9zIi0Uml3nSYGvE+UB3QROE2NXxJmA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mi8uqq72aLpQc898sKeKyaeHIgD0rr+SIL3ectcBMvobQZ19tTuXqBnAUAWk1lpXv UuVtvJbEF9nsRSK1NuZ0etl6ALP8LKC9Ng2bbY9PwvAU6INe1nsAsu+Gee0CnE+3VF 8lOuJbLLNt7yNE+fcNfVpaP0AY7vEtNYQQMV1rWo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrii Nakryiko , Daniel Borkmann , Sasha Levin Subject: [PATCH 5.18 406/879] selftests/bpf: Prevent skeleton generation race Date: Tue, 7 Jun 2022 18:58:44 +0200 Message-Id: <20220607165014.646932607@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,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 From: Andrii Nakryiko [ Upstream commit 1e2666e029e5cc2b81dbd7c85af5bcc8c80524e0 ] Prevent "classic" and light skeleton generation rules from stomping on each other's toes due to the use of the same .linked{1,2,3}.o naming pattern. There is no coordination and synchronizataion between .skel.h and .lskel.h rules, so they can easily overwrite each other's intermediate object files, leading to errors like: /bin/sh: line 1: 170928 Bus error (core dumped) /data/users/andriin/linux/tools/testing/selftests/bpf/tools/sbin/bpftool gen skeleton /data/users/andriin/linux/tools/testing/selftests/bpf/test_ksyms_weak.linked3.o name test_ksyms_weak > /data/users/andriin/linux/tools/testing/selftests/bpf/test_ksyms_weak.skel.h make: *** [Makefile:507: /data/users/andriin/linux/tools/testing/selftests/bpf/test_ksyms_weak.skel.h] Error 135 make: *** Deleting file '/data/users/andriin/linux/tools/testing/selftests/bpf/test_ksyms_weak.skel.h' Fix by using different suffix for light skeleton rule. Fixes: c48e51c8b07a ("bpf: selftests: Add selftests for module kfunc support") Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220509004148.1801791-2-andrii@kernel.org Signed-off-by: Sasha Levin --- tools/testing/selftests/bpf/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 3820608faf57..a15c47d2fa73 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -415,11 +415,11 @@ $(TRUNNER_BPF_SKELS): %.skel.h: %.o $(BPFTOOL) | $(TRUNNER_OUTPUT) $(TRUNNER_BPF_LSKELS): %.lskel.h: %.o $(BPFTOOL) | $(TRUNNER_OUTPUT) $$(call msg,GEN-SKEL,$(TRUNNER_BINARY),$$@) - $(Q)$$(BPFTOOL) gen object $$(<:.o=.linked1.o) $$< - $(Q)$$(BPFTOOL) gen object $$(<:.o=.linked2.o) $$(<:.o=.linked1.o) - $(Q)$$(BPFTOOL) gen object $$(<:.o=.linked3.o) $$(<:.o=.linked2.o) - $(Q)diff $$(<:.o=.linked2.o) $$(<:.o=.linked3.o) - $(Q)$$(BPFTOOL) gen skeleton -L $$(<:.o=.linked3.o) name $$(notdir $$(<:.o=_lskel)) > $$@ + $(Q)$$(BPFTOOL) gen object $$(<:.o=.llinked1.o) $$< + $(Q)$$(BPFTOOL) gen object $$(<:.o=.llinked2.o) $$(<:.o=.llinked1.o) + $(Q)$$(BPFTOOL) gen object $$(<:.o=.llinked3.o) $$(<:.o=.llinked2.o) + $(Q)diff $$(<:.o=.llinked2.o) $$(<:.o=.llinked3.o) + $(Q)$$(BPFTOOL) gen skeleton -L $$(<:.o=.llinked3.o) name $$(notdir $$(<:.o=_lskel)) > $$@ $(TRUNNER_BPF_SKELS_LINKED): $(TRUNNER_BPF_OBJS) $(BPFTOOL) | $(TRUNNER_OUTPUT) $$(call msg,LINK-BPF,$(TRUNNER_BINARY),$$(@:.skel.h=.o)) -- 2.35.1