diff options
| author | Mykyta Yatsenko <yatsenko@meta.com> | 2026-01-15 21:45:09 +0300 |
|---|---|---|
| committer | Andrii Nakryiko <andrii@kernel.org> | 2026-01-17 01:21:11 +0300 |
| commit | 1700147697618a57ed0a2a97d9a477d131b8fc54 (patch) | |
| tree | 18d92ac11f4a29ad81134600cf3ca151a4082b52 /include/linux | |
| parent | 2acbd053c8463c005a0671b2d14a78f38be77c5c (diff) | |
| download | linux-1700147697618a57ed0a2a97d9a477d131b8fc54.tar.xz | |
bpf: Add __force annotations to silence sparse warnings
Add __force annotations to casts that convert between __user and kernel
address spaces. These casts are intentional:
- In bpf_send_signal_common(), the value is stored in si_value.sival_ptr
which is typed as void __user *, but the value comes from a BPF
program parameter.
- In the bpf_*_dynptr() kfuncs, user pointers are cast to const void *
before being passed to copy helper functions that correctly handle
the user address space through copy_from_user variants.
Without __force, sparse reports:
warning: cast removes address space '__user' of expression
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Mykyta Yatsenko <yatsenko@meta.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20260115184509.3585759-1-mykyta.yatsenko5@gmail.com
Closes: https://lore.kernel.org/oe-kbuild-all/202601131740.6C3BdBaB-lkp@intel.com/
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
