From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 60C03A034F for ; Wed, 10 Nov 2021 07:43:44 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 57A1B4068B; Wed, 10 Nov 2021 07:43:44 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2057.outbound.protection.outlook.com [40.107.237.57]) by mails.dpdk.org (Postfix) with ESMTP id 1F9A74014D for ; Wed, 10 Nov 2021 07:43:43 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KBX/Jxd/4No/8uCbDQrLng7+4UrzRzWFGvOtLVO3nA0gNc8Zo+wcr3wmElY2Ys/VddaNYM3D8iGfHSjEgSuRmuMuXy2RFov3h9qHpGlG7v8+/IQ8BAYbi9GZIxeHCQ1yIbFcF9KcAdDywYETkdKvonUu0RxzWJoi0ODAxIipdN3ivqc1yaFdk8SrJPvauI0jU0xYRwVV2zcwADAthGJvtwOrz8e46K8dkTnfk7HoV8TXCeaWh3Jx+SWBe4WPU28fs6BftPNjkdFy5sVmPghCwMqvcpc40eDqrP+5qZWjVOtuZ9uTlolGSTxivGdST2v2OGKuaJ7Z6XTAxe/BnjH4aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FUQFRFVC8/ehd3eaFJ+WAyAAFi/2bdNJWUKau03O7uA=; b=FnxyQQet4yDqx5+yy5RTmXySeOwdT2cWwgKlAsB5rDwdMKRqCJrhRCgNfZAFIXgKsiz+wI85U3GKSIdPCDIrSfPrPGOdLxvc22aAv5BIN4hMP2VemtmeSUMZEQx8Em//9NxAFOq+sUjvtpXnip/Akg0zNLtIvzloyF63uN/JokAt60UtzRWkZfaGBfyIl/x9zJ/QhgZyXhYnv0B84srFg+RbmMls9g6Im3x5mCSNp4c5FpOH2KUO9un4M6NBSs3gZihiXmmr5afPifI/J4XvJdOONjy0/SNIZri2D0frCKpx75/MNTHCSQv5bwZk4BfwXsoCmievESaGdu1IjFucoA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=microsoft.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FUQFRFVC8/ehd3eaFJ+WAyAAFi/2bdNJWUKau03O7uA=; b=jO1Vf0nrf57kv4fG0jszUP4OUKh2OEAJvh1Ro2SUS6ErwzZr/Z6FBMCquvcV/ASltTXUogV9DafokPNL3/lPyiXDtZ1/8Bc/ayshtw+6/Jqy+MfJAlYDbAII7ikPzMk6FpP4/g2KED/WxMiF8aAwlrittuEf65Rm+2belO5Ka4iAUbUJKZTEo7Pa9KFPKNFFNy8GP2YYa2MrEC4o7US2b2tMTL0fVBaq6i5SOljXeSNL0qApzLR9ZYr7DeiOJnowGUnilay7jhb77QdqY62MscICK4sda5rOgoy2N0ICZQObaYAn7mVU4/hmpPBuu2Lcou61RjQgIQeyucytwrxeMQ== Received: from DM6PR06CA0090.namprd06.prod.outlook.com (2603:10b6:5:336::23) by BY5PR12MB4888.namprd12.prod.outlook.com (2603:10b6:a03:1d8::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.16; Wed, 10 Nov 2021 06:43:40 +0000 Received: from DM6NAM11FT004.eop-nam11.prod.protection.outlook.com (2603:10b6:5:336:cafe::56) by DM6PR06CA0090.outlook.office365.com (2603:10b6:5:336::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 06:43:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT004.mail.protection.outlook.com (10.13.172.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4669.10 via Frontend Transport; Wed, 10 Nov 2021 06:43:40 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 10 Nov 2021 06:43:36 +0000 From: Xueming Li To: David Marchand CC: Luca Boccassi , Long Li , dpdk stable Date: Wed, 10 Nov 2021 14:29:46 +0800 Message-ID: <20211110063216.2744012-103-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211110063216.2744012-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 78fd878b-b044-44f0-d1c9-08d9a4156e4c X-MS-TrafficTypeDiagnostic: BY5PR12MB4888: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BqzBffzpzp6zmzEX1a2AQsi6HYs0z2VGgSDfyA0/kFkT447zEBM2s1EnA4Ni1603ajbo7quLW9r7D9uSDic/1Ehsqpuo6nHbiKtNE6szr2SVz5thU0hNLHtNXpXHnHpwEzyZSRpGdVnqorzsF0BfUaqI0pz+r+XZrxJ2Ulwu0xbbXuQqlkPEn50iLGtiz4esUGUsdsojvvWUpcpiEaBLLscxcCtSBz8YuszVirsrjvxm6jU+DKBeejvmSN34cq0QSqmfp2yCYAMeUjVBzzsv1NaixMpW977hXGEPlCWjDZgKU8YsggsAOk4x7iZeNAGLucT5ofmhwnvd713juuQXdUIBJkoq61woaVLCbQGSelj9upH+Ijon+gNsyV+nXkP5+7st8j6IJ/3azyQvSeTEdsnujWzFNyziWevLf5+ncP4hgQ/9o7o01LZBlwbu8VTR+FCB3cdnxf3etuyB6ftrxQM8EVnUxuBn+mhtEPUs6EsKUAY1/KdUQOvPAZcbf7V1DbEcLw330s9yyAMxWZjG2zlG+xDqhc4FOC4ZV/uy2VIInEt9MMjBJSkxMYEWkEutpllvKNyh5F3dDrVWIEXILtjMSRbOztyJyzLSGE3GzZ+217KZNQHSVxex38/sXtLUIfFiBb4Xcd5eYhq4/h38eLt2nykHJDsPl+1IC47buBICuk6BGyeOVcXrdw8fL3ss+isXmVbYwpwHvqXibwtwR0CBnBr/W8o4IaShyP0XUXxl5efbdXBm5dfs40K7nAHLIFJzl1XdDbAJdN7fj/U4Anij+Xyf9Z0PFR9Z3wQMaNkBTpjWsa0OgTdDmQUAzn6yMhz0vt8tkeRsai4tGu4ibg== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(6916009)(82310400003)(316002)(86362001)(5660300002)(4001150100001)(54906003)(36860700001)(36756003)(7636003)(356005)(70586007)(26005)(2906002)(6286002)(16526019)(186003)(8676002)(6666004)(4326008)(83380400001)(7696005)(70206006)(1076003)(55016002)(47076005)(45080400002)(966005)(53546011)(8936002)(426003)(508600001)(336012)(2616005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:43:40.0353 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 78fd878b-b044-44f0-d1c9-08d9a4156e4c X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT004.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4888 Subject: [dpdk-stable] patch 'bus/vmbus: fix leak on device scan' has been queued to stable release 20.11.4 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/12/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/a00d38a2e164c755bfb96192c3da52cc7db4d935 Thanks. Xueming Li --- >From a00d38a2e164c755bfb96192c3da52cc7db4d935 Mon Sep 17 00:00:00 2001 From: David Marchand Date: Sat, 2 Oct 2021 18:24:30 +0200 Subject: [PATCH] bus/vmbus: fix leak on device scan Cc: Xueming Li [ upstream commit c6c865d7e2e47a3a1a65a091103cca056bb073ef ] Caught running ASAN. The device name was leaked on scan. rte_device name field being a const, use a local pointer and release in error path. Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support") Signed-off-by: David Marchand Acked-by: Long Li --- drivers/bus/vmbus/linux/vmbus_bus.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/bus/vmbus/linux/vmbus_bus.c b/drivers/bus/vmbus/linux/vmbus_bus.c index 3c924eee14..68f6cc5742 100644 --- a/drivers/bus/vmbus/linux/vmbus_bus.c +++ b/drivers/bus/vmbus/linux/vmbus_bus.c @@ -236,13 +236,14 @@ vmbus_scan_one(const char *name) char filename[PATH_MAX]; char dirname[PATH_MAX]; unsigned long tmp; + char *dev_name; dev = calloc(1, sizeof(*dev)); if (dev == NULL) return -1; dev->device.bus = &rte_vmbus_bus.bus; - dev->device.name = strdup(name); + dev->device.name = dev_name = strdup(name); if (!dev->device.name) goto error; @@ -261,6 +262,7 @@ vmbus_scan_one(const char *name) /* skip non-network devices */ if (rte_uuid_compare(dev->class_id, vmbus_nic_uuid) != 0) { + free(dev_name); free(dev); return 0; } @@ -312,6 +314,7 @@ vmbus_scan_one(const char *name) } else { /* already registered */ VMBUS_LOG(NOTICE, "%s already registered", name); + free(dev_name); free(dev); } return 0; @@ -322,6 +325,7 @@ vmbus_scan_one(const char *name) error: VMBUS_LOG(DEBUG, "failed"); + free(dev_name); free(dev); return -1; } -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:06.540125205 +0800 +++ 0102-bus-vmbus-fix-leak-on-device-scan.patch 2021-11-10 14:17:01.864079479 +0800 @@ -1 +1 @@ -From c6c865d7e2e47a3a1a65a091103cca056bb073ef Mon Sep 17 00:00:00 2001 +From a00d38a2e164c755bfb96192c3da52cc7db4d935 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit c6c865d7e2e47a3a1a65a091103cca056bb073ef ] @@ -12 +14,0 @@ -Cc: stable@dpdk.org