bpf/selftests: Test PTR_TO_RDONLY_MEM
authorHao Luo <haoluo@google.com>
Thu, 28 Apr 2022 23:57:50 +0000 (16:57 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 1 May 2022 15:22:26 +0000 (17:22 +0200)
commit379382b347dbd2058eb0bf7f269aed01985f8cf6
treeaa2619f1cce3d91f97e0f0268ceebf6b7dd07386
parent2a77c58726aba893129a369ed3d2be004dda41cd
bpf/selftests: Test PTR_TO_RDONLY_MEM

commit 9497c458c10b049438ef6e6ddda898edbc3ec6a8 upstream.

This test verifies that a ksym of non-struct can not be directly
updated.

Signed-off-by: Hao Luo <haoluo@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20211217003152.48334-10-haoluo@google.com
Cc: stable@vger.kernel.org # 5.15.x
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/bpf/prog_tests/ksyms_btf.c
tools/testing/selftests/bpf/progs/test_ksyms_btf_write_check.c [new file with mode: 0644]