Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3294258rwa; Tue, 23 Aug 2022 02:09:48 -0700 (PDT) X-Google-Smtp-Source: AA6agR4kJ5GAeLKdehjFb63YY1+jdfYppjLCDl45T7xAz8k3zqPn4go8O4gT5Pvedk1J380pQJtG X-Received: by 2002:a05:6402:530c:b0:43b:c6bf:a496 with SMTP id eo12-20020a056402530c00b0043bc6bfa496mr2800651edb.282.1661245787987; Tue, 23 Aug 2022 02:09:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661245787; cv=none; d=google.com; s=arc-20160816; b=yxcXq2FtYQZTJ1V7kHgi2znIZ6Gsz10OpoihV+q7QRg84I+3tRs6WYqId2iJah8s60 EWzxqfHfrdLVAzdA0EWdsRQx3xHHtAvxIo968Hkc3tX1et0HMLSWHwBAuMlbhP3eeTPl rZKL/jJYUDuRLov4WlG3PRg96kUmn24B3GRCgBfqOy2J5OtyR//11BO8thMQIWYvPW1S MqQYP+QUA+ULK9CTOlrb5njZ9VDLRjnqKHBzQTK7VygJgEUHCR9lNcrEwFlKhlaLKnXg L97VPH8ix16mMuF8flbKGwNfXrsL0rZzkv7CHWB5F9HBjUDVLIc1tV/KLVocbbmEBCue V0Fw== 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=9X8G6S/qp/8qAAGejTGaCrx8dK0ToDIdW5Umzf5uumU=; b=RBdI/N0yFmVWb465A3aiQpLXRYCUAuUblxwbZ9R5gQGewVtOG0xi/MxClqRBIJugYG rc/jFHWzGhhvMiIYpAzd1gQOR8ne21Ql74Dyje1gm9fj1aYi8wmkI0275W19bGutQeNX CeNgHcu/6rph5NkDbHo263BWJAWSNPXOOLppZNXswR15D94U4IP3/ZI8Wn5GvGik4Emw lhRmK9775X7g5lRXSbb4uzSUegCu4cmlncQGjA0cF8Z6dXIwgV/YHR4Cp0Lx0lDnpABG n6ilqAbj+lIMd+anTCo1U3Zhx1PFF8aAX9UWZOg8G92yBEQTqZEX12XOi0tDVHxR8lIN fs9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xhJFL6nh; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t5-20020a50d705000000b00446b318cf25si1508138edi.329.2022.08.23.02.09.21; Tue, 23 Aug 2022 02:09:47 -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=@linuxfoundation.org header.s=korg header.b=xhJFL6nh; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346222AbiHWIjF (ORCPT + 99 others); Tue, 23 Aug 2022 04:39:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344284AbiHWIhP (ORCPT ); Tue, 23 Aug 2022 04:37:15 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05CA577EB5; Tue, 23 Aug 2022 01:17:58 -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 sin.source.kernel.org (Postfix) with ESMTPS id C53BCCE1B34; Tue, 23 Aug 2022 08:16:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C87EDC433C1; Tue, 23 Aug 2022 08:16:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661242615; bh=epO8K098BtRj6Sc5ipRdBeNNa94m9Yx6xf3h4PdWRFY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xhJFL6nhxQEmCq8NbRpC4ENDNTtLzV5BWoujyXM1KcepPHwSPbpBMxVqfaWXzfMKs wiNXs03rq8N0b3fQRZci+Hf18zx/Qn07zJQ3yUm5vMsGIBaQ2qLbtSa0Nt8QOjEbfp sGYHvp0bX6n7wOFFKqP/8ma/09Xf98RBP4NkwC1Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ondrej Mosnacek , Masahiro Yamada Subject: [PATCH 5.19 145/365] kbuild: dummy-tools: avoid tmpdir leak in dummy gcc Date: Tue, 23 Aug 2022 10:00:46 +0200 Message-Id: <20220823080124.294570326@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080118.128342613@linuxfoundation.org> References: <20220823080118.128342613@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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: Ondrej Mosnacek commit aac289653fa5adf9e9985e4912c1d24a3e8cbab2 upstream. When passed -print-file-name=plugin, the dummy gcc script creates a temporary directory that is never cleaned up. To avoid cluttering $TMPDIR, instead use a static directory included in the source tree. Fixes: 76426e238834 ("kbuild: add dummy toolchains to enable all cc-option etc. in Kconfig") Signed-off-by: Ondrej Mosnacek Signed-off-by: Masahiro Yamada Signed-off-by: Greg Kroah-Hartman --- .../dummy-tools/dummy-plugin-dir/include/plugin-version.h | 0 scripts/dummy-tools/gcc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) create mode 100644 scripts/dummy-tools/dummy-plugin-dir/include/plugin-version.h --- a/scripts/dummy-tools/gcc +++ b/scripts/dummy-tools/gcc @@ -96,12 +96,8 @@ fi # To set GCC_PLUGINS if arg_contain -print-file-name=plugin "$@"; then - plugin_dir=$(mktemp -d) - - mkdir -p $plugin_dir/include - touch $plugin_dir/include/plugin-version.h - - echo $plugin_dir + # Use $0 to find the in-tree dummy directory + echo "$(dirname "$(readlink -f "$0")")/dummy-plugin-dir" exit 0 fi