]> git.baikalelectronics.ru Git - 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)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 21 Oct 2019 12:49:12 +0000 (14:49 +0200)
commit5a03afca1d2c7e08da7404b35c51fe02577367b3
treeef4141b3fcf60d3da65aa88e7c81490b8fe552f7
parenta03920a5454642d27be4619e45fec3a2aeeb4cd6
selftests/bpf: Make a copy of subtest name

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
tools/testing/selftests/bpf/test_progs.c