Commit 0db63c0b authored by Alexei Starovoitov's avatar Alexei Starovoitov Committed by Martin KaFai Lau
Browse files

bpf: Fix verifier assumptions about socket->sk



The verifier assumes that 'sk' field in 'struct socket' is valid
and non-NULL when 'socket' pointer itself is trusted and non-NULL.
That may not be the case when socket was just created and
passed to LSM socket_accept hook.
Fix this verifier assumption and adjust tests.

Reported-by: default avatarLiam Wisehart <liamwisehart@meta.com>
Acked-by: default avatarKumar Kartikeya Dwivedi <memxor@gmail.com>
Fixes: 6fcd486b ("bpf: Refactor RCU enforcement in the verifier.")
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/r/20240427002544.68803-1-alexei.starovoitov@gmail.com


Signed-off-by: default avatarMartin KaFai Lau <martin.lau@kernel.org>
parent 89de2db1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment