]> git.ipfire.org Git - thirdparty/linux.git/commit
bpf: Convert bpf_sock_addr_kern "uaddr" to sockaddr_unsized
authorKees Cook <kees@kernel.org>
Tue, 4 Nov 2025 00:26:15 +0000 (16:26 -0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 5 Nov 2025 03:10:33 +0000 (19:10 -0800)
commitc1a799eef62b8c3298a4d82753fe0f2a448e5e4f
treedee55ee7a35c0c84867ecc2cd80edbf4a43d27b1
parent8116d803e7f8f20bf00ce23ff8bd0baab41e1635
bpf: Convert bpf_sock_addr_kern "uaddr" to sockaddr_unsized

Change struct bpf_sock_addr_kern to use sockaddr_unsized for the "uaddr"
field instead of sockaddr. This improves type safety in the BPF cgroup
socket address filtering code.

The casting in __cgroup_bpf_run_filter_sock_addr() is updated to match the
new type, removing an unnecessary cast in the initialization and updating
the conditional assignment to use the appropriate sockaddr_unsized cast.

Additionally rename the "unspec" variable to "storage" to better align
with its usage.

No binary changes expected.

Signed-off-by: Kees Cook <kees@kernel.org>
Link: https://patch.msgid.link/20251104002617.2752303-7-kees@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/filter.h
kernel/bpf/cgroup.c