]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests/bpf: ksym_search won't check symbols exists
authorDaniel T. Lee <danieltimlee@gmail.com>
Wed, 3 Apr 2019 22:17:55 +0000 (07:17 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:43:38 +0000 (06:43 -0700)
commitf382ab1afe260e60dc555619e5d196aa52afaa10
tree777379cf525bd49342f7e5beea0dc9d4d60a36b7
parent3f52cbfe83967fbef59e8e174764409d0539ea5e
selftests/bpf: ksym_search won't check symbols exists

[ Upstream commit 0979ff7992fb6f4eb837995b12f4071dcafebd2d ]

Currently, ksym_search located at trace_helpers won't check symbols are
existing or not.

In ksym_search, when symbol is not found, it will return &syms[0](_stext).
But when the kernel symbols are not loaded, it will return NULL, which is
not a desired action.

This commit will add verification logic whether symbols are loaded prior
to the symbol search.

Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/bpf/trace_helpers.c