diff options
| author | Kuniyuki Iwashima <kuniyu@google.com> | 2026-05-05 00:04:53 +0300 |
|---|---|---|
| committer | Martin KaFai Lau <martin.lau@kernel.org> | 2026-05-08 21:38:10 +0300 |
| commit | 1c2958e4ab1ed4594db16425dbcab33c56ea8330 (patch) | |
| tree | 5a72f3fd80218d19ecd2841a1effb21fefcc5074 /include/linux/stringify.h | |
| parent | 843064b0a77eed3d6d63ffc53aeaa359672b4e12 (diff) | |
| download | linux-1c2958e4ab1ed4594db16425dbcab33c56ea8330.tar.xz | |
bpf: tcp: Fix type confusion in sol_tcp_sockopt().
sol_tcp_sockopt() only checks if sk->sk_protocol is IPPROTO_TCP,
but RAW socket can bypass it:
socket(AF_INET, SOCK_RAW, IPPROTO_TCP)
Let's use sk_is_tcp().
Note that initially sol_tcp_sockopt() checked sk->sk_prot->setsockopt.
Fixes: 2ab42c7b871f ("bpf: Check the protocol of a sock to agree the calls to bpf_setsockopt().")
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://patch.msgid.link/20260504210610.180150-7-kuniyu@google.com
Diffstat (limited to 'include/linux/stringify.h')
0 files changed, 0 insertions, 0 deletions
