Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3407813rwa; Tue, 23 Aug 2022 04:23:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR7y5Nci3aM0Vo0NrY6ugZiMIPt4QnWQdii/VpcqXYH4ucMSirM0vSl+AOJpLr1dolGfi+It X-Received: by 2002:a65:4c07:0:b0:427:bbde:99c with SMTP id u7-20020a654c07000000b00427bbde099cmr20299027pgq.390.1661253814031; Tue, 23 Aug 2022 04:23:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253814; cv=none; d=google.com; s=arc-20160816; b=h46TtZV1BugHVXzvgqKLxc9yI1t8OZtsmpxjZrOYSASNyz5iDZYXXS6xBJOa+XqiIc K5PRprKE9OpYM3RppyS0X365QAMm3JXNXgDqmOVh4g8FH7nzaSWe78GtSiR1wKvOKmEz Oqk6e2LugmRr67PuD5CrsuSKN3c2q4VmvaY4xsj6KPPXA1KWD2j1LmlWUy0Ka6ybjU18 +JqOBTRZZRuEhMPzX/7/kAmCpnw+y8b9samWu1qcpY7mu7ZHdPYf1ZPN+nf4ZTr9Q2rI 6JfhjT8SJobtyf9t5zi+Zo/q1+/diK4WuonERzvVBVt9a7jQwkEiBPwqioYF87/o4SQm dzZg== 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=AsxnpBrSh19IfbHF0/tOBBedsdkj/UdOjaxWbGeT86g=; b=g7WO2h0S8K92mQ4h1gABOGT5s//Zb3WItlmb5MBXGwCEgZreS7fY3rrDdbH87NQEjh LaMQ2DTdohm/zYFhic8El31OjmjyZh45oh9TSyWIjyKhCtllqnbIqtotSrJfFjkn67Gx QFZzDl0pmwWMAKFepIBCvXxXyionQOkzSe8J8oWNq5G3AfIQh7IhDcUsMkTkXGwvH39J nz15wicFzug/4k1j+/g87+GVdZsvuz2BJmsRC7TQDnip7lhll7bHDMWMAvU0Dt7PgDZk VApPGX2euLDA5vKr++wJCzi8NNmbldc+K1lhryIxbnJnftr2U/bDRzk/JaSLj9VqS+pb TFow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=icm6VwMY; 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 oj15-20020a17090b4d8f00b001fab8938920si5709724pjb.152.2022.08.23.04.23.22; Tue, 23 Aug 2022 04:23:34 -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=icm6VwMY; 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 S1344455AbiHWKAM (ORCPT + 99 others); Tue, 23 Aug 2022 06:00:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351939AbiHWJ4J (ORCPT ); Tue, 23 Aug 2022 05:56:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99C266E2F1; Tue, 23 Aug 2022 01:47:05 -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 766D661377; Tue, 23 Aug 2022 08:47:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7FED3C433D6; Tue, 23 Aug 2022 08:47:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244423; bh=V8FuMfxWiHZBxPbrlGmg+HCvzmlMc32jHvv7Xlh8gbo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=icm6VwMY5n0xWWazuniyrNM/18hKvfUlCpDK6SDOP4bigRVXagnd0KDHlmBaEQp0U dQffGQOCsAvlvb95iLDFs/jSWwbbHNQTB79B5eC+OK5Msu7qc93gSqdNlDEO6hjCoi MECOGjiA++f/l2DSC3WmUUAn2wf24chlLd41dofQ= 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.15 092/244] kbuild: dummy-tools: avoid tmpdir leak in dummy gcc Date: Tue, 23 Aug 2022 10:24:11 +0200 Message-Id: <20220823080102.089385419@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080059.091088642@linuxfoundation.org> References: <20220823080059.091088642@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 ++------ 2 files changed, 2 insertions(+), 6 deletions(-) create mode 100644 scripts/dummy-tools/dummy-plugin-dir/include/plugin-version.h diff --git a/scripts/dummy-tools/dummy-plugin-dir/include/plugin-version.h b/scripts/dummy-tools/dummy-plugin-dir/include/plugin-version.h new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/scripts/dummy-tools/gcc b/scripts/dummy-tools/gcc index b2483149bbe5..7db825843435 100755 --- 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 -- 2.37.2