linux/kernel/bpf
Jerome Marchand 2eb7648558 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 37cce22dbd ("bpf: verifier: Refactor helper access
type tracking"), all helper accesses were considered as a possible
write access by the verifier, so no big harm was done. However, since
then, the verifier might make wrong asssumption about the content of
that address which might lead it to make faulty optimizations (such as
removing code that was wrongly labeled dead). This is what happens in
test_sysctl selftest to the tests related to sysctl_get_name.

Add MEM_WRITE flag the second argument of bpf_sysctl_get_name().

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20250619140603.148942-2-jmarchan@redhat.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2025-06-23 21:50:44 -07:00
..
preload bpf: Add namespace to BPF internal symbols 2025-04-25 09:21:23 -07:00
arena.c bpf_try_alloc_pages 2025-03-30 13:45:28 -07:00
arraymap.c
bloom_filter.c
bpf_cgrp_storage.c
bpf_inode_storage.c
bpf_iter.c
bpf_local_storage.c
bpf_lru_list.c bpf: Adjust free target to avoid global starvation of LRU map 2025-06-18 18:50:14 -07:00
bpf_lru_list.h bpf: Adjust free target to avoid global starvation of LRU map 2025-06-18 18:50:14 -07:00
bpf_lsm.c
bpf_struct_ops.c bpf: Pass the same orig_call value to trampoline functions 2025-05-14 17:48:57 -07:00
bpf_task_storage.c
btf_iter.c
btf_relocate.c
btf.c bpf-next-6.16 2025-05-28 15:52:42 -07:00
cgroup_iter.c
cgroup.c bpf: Specify access type of bpf_sysctl_get_name args 2025-06-23 21:50:44 -07:00
core.c bpf: Avoid __bpf_prog_ret0_warn when jit fails 2025-05-27 10:43:10 -07:00
cpumap.c
cpumask.c
crypto.c
devmap.c
disasm.c
disasm.h
dispatcher.c
dmabuf_iter.c bpf: Add open coded dmabuf iterator 2025-05-27 09:51:25 -07:00
hashtab.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf after rc4 2025-04-28 08:40:45 -07:00
helpers.c bpf: Check rcu_read_lock_trace_held() in bpf_map_lookup_percpu_elem() 2025-05-27 10:45:59 -07:00
inode.c VFS: rename lookup_one_len family to lookup_noperm and remove permission check 2025-04-08 11:24:36 +02:00
Kconfig
kmem_cache_iter.c
link_iter.c
local_storage.c
log.c
lpm_trie.c bpf: Convert lpm_trie.c to rqspinlock 2025-03-19 08:03:05 -07:00
Makefile bpf: Add dmabuf iterator 2025-05-27 09:51:25 -07:00
map_in_map.c
map_in_map.h
map_iter.c
memalloc.c
mmap_unlock_work.h
mprog.c
net_namespace.c
offload.c
percpu_freelist.c
percpu_freelist.h
prog_iter.c
queue_stack_maps.c bpf: Convert queue_stack map to rqspinlock 2025-04-10 12:51:10 -07:00
range_tree.c
range_tree.h
relo_core.c
reuseport_array.c
ringbuf.c bpf: Convert ringbuf map to rqspinlock 2025-04-11 10:28:26 -07:00
rqspinlock.c bpf: Use architecture provided res_smp_cond_load_acquire 2025-04-10 12:47:07 -07:00
rqspinlock.h
stackmap.c
syscall.c - The 11 patch series "Add folio_mk_pte()" from Matthew Wilcox 2025-05-31 15:44:16 -07:00
sysfs_btf.c btf: Allow mmap of vmlinux btf 2025-05-23 10:06:28 -07:00
task_iter.c
tcx.c
tnum.c
token.c
trampoline.c
verifier.c bpf: Mark dentry->d_inode as trusted_or_null 2025-06-17 08:40:59 -07:00