aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorJason Xing <[email protected]>2025-02-20 07:29:32 +0000
committerMartin KaFai Lau <[email protected]>2025-02-20 22:29:10 +0000
commit2958624b25305142e24203165ff65409ba9dd9d7 (patch)
tree5d1bb28eae490c7f297b47f3c7f7056a47b2871f /net/core/dev.c
parentbpf: Prevent unsafe access to the sock fields in the BPF timestamping callback (diff)
downloadkernel-2958624b25305142e24203165ff65409ba9dd9d7.tar.gz
kernel-2958624b25305142e24203165ff65409ba9dd9d7.zip
bpf: Disable unsafe helpers in TX timestamping callbacks
New TX timestamping sock_ops callbacks will be added in the subsequent patch. Some of the existing BPF helpers will not be safe to be used in the TX timestamping callbacks. The bpf_sock_ops_setsockopt, bpf_sock_ops_getsockopt, and bpf_sock_ops_cb_flags_set require owning the sock lock. TX timestamping callbacks will not own the lock. The bpf_sock_ops_load_hdr_opt needs the skb->data pointing to the TCP header. This will not be true in the TX timestamping callbacks. At the beginning of these helpers, this patch checks the bpf_sock->op to ensure these helpers are used by the existing sock_ops callbacks only. Signed-off-by: Jason Xing <[email protected]> Signed-off-by: Martin KaFai Lau <[email protected]> Link: https://patch.msgid.link/[email protected]
Diffstat (limited to 'net/core/dev.c')
0 files changed, 0 insertions, 0 deletions