Merge branch 'bpf-specify-access-type-of-bpf_sysctl_get_name-args'
authorAlexei Starovoitov <ast@kernel.org>
Tue, 24 Jun 2025 04:50:44 +0000 (21:50 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 24 Jun 2025 04:50:44 +0000 (21:50 -0700)
commit190113989ae01da7f5925877815a3ac75856d9ed
tree444d25b1ef1bce34dd5dd4182bce6a0e0023ce85
parentaa485e8789d56a4573f7c8d000a182b749eaa64d
parentb8a205486ed5c0c5c0386e472157a81ce686af25
Merge branch 'bpf-specify-access-type-of-bpf_sysctl_get_name-args'

Jerome Marchand says:

====================
bpf: Specify access type of bpf_sysctl_get_name args

The second argument of bpf_sysctl_get_name() helper is a pointer to a
buffer that is being written to. However that isn't specify in the
prototype. Until commit 37cce22dbd51a ("bpf: verifier: Refactor helper
access type tracking") that mistake was hidden by the way the verifier
treated helper accesses. Since then, the verifier, working on wrong
infromation from the prototype, can make faulty optimization that
would had been caught by the test_sysctl selftests if it was run by
the CI.

The first patch fixes bpf_sysctl_get_name prototype.

The second patch converts the test_sysctl to prog_tests so that it
will be run by the CI and catch similar issues in the future.

Changes in v3:
 - Use ASSERT* macro instead of CHECK_FAIL.
 - Remove useless code.

Changes in v2:
 - Replace ARG_PTR_TO_UNINIT_MEM by ARG_PTR_TO_MEM | MEM_WRITE.
 - Converts test_sysctl to prog_tests.
====================

Link: https://patch.msgid.link/20250619140603.148942-1-jmarchan@redhat.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>