Files
erofs-linux/kernel/bpf
KP Singh 49b18315be bpf: Reject NULL data/sig in bpf_verify_pkcs7_signature
__bpf_dynptr_data() can return NULL (FILE dynptrs, any non-contiguous
backing). bpf_verify_pkcs7_signature() forwards the pointer to
verify_pkcs7_signature() unchecked, causing a NULL deref in
asn1_ber_decoder() reachable from a sleepable BPF LSM at lsm.s/bpf.

NULL-check both pointers and reject with -EINVAL. Mirrors the guards
already in kernel/bpf/crypto.c.

Fixes: 865b0566d8 ("bpf: Add bpf_verify_pkcs7_signature() kfunc")
Reported-by: Xianrui Dong <[email protected]>
Signed-off-by: KP Singh <[email protected]>
Reviewed-by: Amery Hung <[email protected]>
Acked-by: Song Liu <[email protected]>
Acked-by: Daniel Borkmann <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Signed-off-by: Kumar Kartikeya Dwivedi <[email protected]>
2026-05-20 05:12:05 +02:00
..
…
…
…
…
2026-04-10 15:13:38 -07:00
…
…
2026-03-24 08:45:29 -07:00