From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D50F2D0621; Tue, 26 Aug 2025 13:43:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756215829; cv=none; b=oDwk0q1piHaRoo8o/P/zwtFOwfvxnMQYnlnYGZSy9dR5VxS8lIw4Zkhhek/Vy28WpQlHxz2G8qcA0uA+NyokOkaXTrNL9EFfHeT+IlOdmcB8nngTHwdfBp6rJi7VAHIxUtnY0/h77hGXzI7FACt+z+rK+Fa+oa+15inCSvrrjwA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756215829; c=relaxed/simple; bh=L3NX2TuBDmpxVAbAa/kqAtuL1H6GkpGcQMom/NKJaoc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cESiGjnobNw4HdCI6OIPNanVpc4BA7c5AL96JNm7Aq9kKQRCrPpoHYXUviZSyHiieNOFFZXz+g6WQ7LuLKniUiaMjFpNd9FgKlK3NZuZ3A9XlHDDtw7XZlAmlf+5+Iy1OcJUjbcZWKOyCtnHGLnOhTfWJ4vhYT8b4CHO1IwBzFI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=i/bVNPZe; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="i/bVNPZe" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49C6DC4CEF1; Tue, 26 Aug 2025 13:43:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756215828; bh=L3NX2TuBDmpxVAbAa/kqAtuL1H6GkpGcQMom/NKJaoc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i/bVNPZe0clb4jz9aRvndVdqADvRxgg8VOIF7fJ+kX1lJJCbRWPNBKYdSJbwM/y+R uG0gO1ECFS23FvFP0qkrGC8wha/5XQeC8n0Y8q9dVAlXnnqB/O8ottkc4x6s/7NQ6x rV+HWtQiStoCHPg46OxKvwCC7oc5FKIAtp8dEN1Y= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Aishwarya TCV , Leo Yan , Ian Rogers , Namhyung Kim , Sasha Levin Subject: [PATCH 5.15 181/644] perf tests bp_account: Fix leaked file descriptor Date: Tue, 26 Aug 2025 13:04:32 +0200 Message-ID: <20250826110950.952590550@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110946.507083938@linuxfoundation.org> References: <20250826110946.507083938@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Leo Yan [ Upstream commit 4a6cdecaa1497f1fbbd1d5307a225b6ca5a62a90 ] Since the commit e9846f5ead26 ("perf test: In forked mode add check that fds aren't leaked"), the test "Breakpoint accounting" reports the error: # perf test -vvv "Breakpoint accounting" 20: Breakpoint accounting: --- start --- test child forked, pid 373 failed opening event 0 failed opening event 0 watchpoints count 4, breakpoints count 6, has_ioctl 1, share 0 wp 0 created wp 1 created wp 2 created wp 3 created wp 0 modified to bp wp max created ---- end(0) ---- Leak of file descriptor 7 that opened: 'anon_inode:[perf_event]' A watchpoint's file descriptor was not properly released. This patch fixes the leak. Fixes: 032db28e5fa3 ("perf tests: Add breakpoint accounting/modify test") Reported-by: Aishwarya TCV Signed-off-by: Leo Yan Reviewed-by: Ian Rogers Link: https://lore.kernel.org/r/20250711-perf_fix_breakpoint_accounting-v1-1-b314393023f9@arm.com Signed-off-by: Namhyung Kim Signed-off-by: Sasha Levin --- tools/perf/tests/bp_account.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/tests/bp_account.c b/tools/perf/tests/bp_account.c index 489b50604cf2..ac39f4947fd8 100644 --- a/tools/perf/tests/bp_account.c +++ b/tools/perf/tests/bp_account.c @@ -89,6 +89,7 @@ static int bp_accounting(int wp_cnt, int share) fd_wp = wp_event((void *)&the_var, &attr_new); TEST_ASSERT_VAL("failed to create max wp\n", fd_wp != -1); pr_debug("wp max created\n"); + close(fd_wp); } for (i = 0; i < wp_cnt; i++) -- 2.39.5