]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
selftests/bpf: Make a copy of subtest name
authorAndrii Nakryiko <andriin@fb.com>
Mon, 21 Oct 2019 03:39:00 +0000 (20:39 -0700)
committerSeth Forshee <seth.forshee@canonical.com>
Mon, 6 Jan 2020 14:16:01 +0000 (08:16 -0600)
commit6d6eb75ae32d571ead7c75772fd30f342675c185
treedfd53e82fb3530b1931fe263fb6c3c1a60771072
parent51a7821f05b211a4a3eb52d4e7f8397d88019d97
selftests/bpf: Make a copy of subtest name

BugLink: https://bugs.launchpad.net/bugs/1858428
[ Upstream commit f90415e9600c5227131531c0ed11514a2d3bbe62 ]

test_progs never created a copy of subtest name, rather just stored
pointer to whatever string test provided. This is bad as that string
might be freed or modified by the end of subtest. Fix this by creating
a copy of given subtest name when subtest starts.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20191021033902.3856966-6-andriin@fb.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
tools/testing/selftests/bpf/test_progs.c