Patch "selftests/bpf: Fix leaked bpf_link in get_stackid_cannot_attach" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    selftests/bpf: Fix leaked bpf_link in get_stackid_cannot_attach

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     selftests-bpf-fix-leaked-bpf_link-in-get_stackid_can.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 8994b14500c02fad61f8086878a69ef113f08c66
Author: Song Liu <song@xxxxxxxxxx>
Date:   Wed Apr 12 14:04:22 2023 -0700

    selftests/bpf: Fix leaked bpf_link in get_stackid_cannot_attach
    
    [ Upstream commit c1e07a80cf23d3a6e96172bc9a73bfa912a9fcbc ]
    
    skel->links.oncpu is leaked in one case. This causes test perf_branches
    fails when it runs after get_stackid_cannot_attach:
    
    ./test_progs -t get_stackid_cannot_attach,perf_branches
    84      get_stackid_cannot_attach:OK
    test_perf_branches_common:PASS:test_perf_branches_load 0 nsec
    test_perf_branches_common:PASS:attach_perf_event 0 nsec
    test_perf_branches_common:PASS:set_affinity 0 nsec
    check_good_sample:FAIL:output not valid no valid sample from prog
    146/1   perf_branches/perf_branches_hw:FAIL
    146/2   perf_branches/perf_branches_no_hw:OK
    146     perf_branches:FAIL
    
    All error logs:
    test_perf_branches_common:PASS:test_perf_branches_load 0 nsec
    test_perf_branches_common:PASS:attach_perf_event 0 nsec
    test_perf_branches_common:PASS:set_affinity 0 nsec
    check_good_sample:FAIL:output not valid no valid sample from prog
    146/1   perf_branches/perf_branches_hw:FAIL
    146     perf_branches:FAIL
    Summary: 1/1 PASSED, 0 SKIPPED, 1 FAILED
    
    Fix this by adding the missing bpf_link__destroy().
    
    Fixes: 346938e9380c ("selftests/bpf: Add get_stackid_cannot_attach")
    Signed-off-by: Song Liu <song@xxxxxxxxxx>
    Signed-off-by: Daniel Borkmann <daniel@xxxxxxxxxxxxx>
    Link: https://lore.kernel.org/bpf/20230412210423.900851-3-song@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/testing/selftests/bpf/prog_tests/get_stackid_cannot_attach.c b/tools/testing/selftests/bpf/prog_tests/get_stackid_cannot_attach.c
index 8d5a6023a1bbf..4022c89ea268a 100644
--- a/tools/testing/selftests/bpf/prog_tests/get_stackid_cannot_attach.c
+++ b/tools/testing/selftests/bpf/prog_tests/get_stackid_cannot_attach.c
@@ -65,6 +65,7 @@ void test_get_stackid_cannot_attach(void)
 	skel->links.oncpu = bpf_program__attach_perf_event(skel->progs.oncpu,
 							   pmu_fd);
 	ASSERT_OK_PTR(skel->links.oncpu, "attach_perf_event_callchain");
+	bpf_link__destroy(skel->links.oncpu);
 	close(pmu_fd);
 
 	/* add exclude_callchain_kernel, attach should fail */



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux