Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp505784lqm; Wed, 1 May 2024 07:22:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW1XlilWYeZLKx9pC/VKHZ0pHmSOnME/S5BKKc08r0Uir6im2y9DT5TW7TZKnw5x6RBu5MzBOQn/hxoqvvUE+f41e9GVUYxOF+KQm4lxw== X-Google-Smtp-Source: AGHT+IF35Siw2l+uk/msZui1KBxPspFaXVg/OGUOn+qOFJYjhs+Ss/FlTOQGyWkVXjF4T6svqDG6 X-Received: by 2002:a05:6a00:10cd:b0:6f3:f970:9f0e with SMTP id d13-20020a056a0010cd00b006f3f9709f0emr3008209pfu.5.1714573353088; Wed, 01 May 2024 07:22:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714573353; cv=pass; d=google.com; s=arc-20160816; b=iG12VBPnDCp6pJ3EDssVnp+X27NgfmV2OyhPMuHUI+GkFK73SgWke+SZGxBKVFQtQ2 3sBEDBVqlfG8sdA38bdN0D3ZwFjTI//uaCMRg5gE2NF76SxKdaoPDZyynKFWCgNWNS6N 0dU3S2L0AYM3UkL1kh2ECxpGRsKxJFiWrs1x+MV3IQ/yGgIggOvDw9YQChiM2rBFJiBk awpB9Xc7cHDAkuaerF3p7gKV/0cLBhJkxYnXvH2RrhgTUOvGrrXuRBXOgKu0/ZvzHXnR MKxU2hiTp6nfdGIrTZ5MAjgm9KatD9S3QxI/Ah50L90yvQpLdRJk8dxt8/2e0z0q0xO+ lUAQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:cc:content-language :references:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=mmjvevk2QGZWN5gC3AU0rMAj2fCTZ6F7apzb1uC7kyc=; fh=HuvpHiwXk+4JYy1ivoELDzGhHFgCjTgWRAg//tvyPT0=; b=ozhw8N/6YtkmdjMnqBhL4Qj8DS5Cihcc1O0suKyoPhI2P20OQkMI8ZsUJyhXK+72ys m3ZzozsGgGsTnwbIfiz8dERUUNpcaNdUp9OqQnIR1Sr0OaHJKwVoCzBVFdgQtYkrlPva 4EB/RwAH3AsPdghsGw+ZXcjjjWGE28RmEpDvJZatzgXu2m9dHciM7tLA0jSlb0pczHl/ ia5GHMtz782tFgIkMGW+wJ87WK2ghZkdNIEZlptAx67MknEpLqlACV11EHKOSAFoFHce nrxgoyLo1LraA831HTDXTBHdPMFjQNgZb0fzC7zjS15hl9X1ytVXfSjHIoEpNs5MhnOf MJyA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-165367-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165367-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id fb7-20020a056a002d8700b006e6c056f450si24205399pfb.213.2024.05.01.07.22.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 07:22:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-165367-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-165367-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165367-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B8703283514 for ; Wed, 1 May 2024 14:22:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9140012F37C; Wed, 1 May 2024 14:22:25 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6DAD112EBEE; Wed, 1 May 2024 14:22:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714573345; cv=none; b=QnJkrnAlXzlO2EcSWAfuYrnrmTsG4wh0ibF+szrTQh5snBMhevclpvW/K6HLpysApH/q4onl/M0VKrqDD9k6wAvNMWqPIww+SxlwdB/f4DLGSJ9oYPiAZuBW2P5/VzNf1gtld/eDB0RiatKNWIIlBClhbd4duoiHtFv+qMwdPis= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714573345; c=relaxed/simple; bh=bLjBVR2yDcjyNrB7DXDJfpvDJVP1OshVgAwlgWDOqxU=; h=Message-ID:Date:MIME-Version:Subject:To:References:Cc:From: In-Reply-To:Content-Type; b=ZJlQI704B2nVIY49b1VO6fBdLziQu04vcQtEGXSaAeEEcMTtUSaOE3Km2Rhc4q2Z/n7x0z8f1WO0eFKUzXs2TS8uH4FDnYynmuQsRFgB9R4PwODgbi8dGKeVoo4kN0hYu1fS3iwrzEUzzZiWtKBeZkd5Q1Pm8FaKCQiqEQyf0VA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EE3E42F4; Wed, 1 May 2024 07:22:48 -0700 (PDT) Received: from [192.168.1.100] (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 48FCF3F71E; Wed, 1 May 2024 07:22:21 -0700 (PDT) Message-ID: <14e1cf11-ce4c-4d83-97da-1bd4e44ae2b0@arm.com> Date: Wed, 1 May 2024 15:22:20 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1] perf lock: More strdup argument freeing To: Ian Rogers References: <20240430184156.1824083-1-irogers@google.com> Content-Language: en-US Cc: zhaimingbing , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Kan Liang , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org From: James Clark In-Reply-To: <20240430184156.1824083-1-irogers@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 30/04/2024 19:41, Ian Rogers wrote: > Leak sanitizer complains about the strdup-ed arguments not being > freed. rec_argv is reordered and duplicates inserted, meaning making > all its contents strdup-ed and freeing them all leads to double frees > or leaks. Add an extra array to track strup-ed arguments and free > them. This makes address sanitier running `perf test` "kernel lock > contention analysis test" memory leak free. > > Signed-off-by: Ian Rogers Reviewed-by: James Clark