Message ID | 20220124151146.376446-2-maximmi@nvidia.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | BPF |
Headers | show |
Series | Bugfixes for syncookie BPF helpers | expand |
Context | Check | Description |
---|---|---|
bpf/vmtest-bpf | success | VM_Test |
bpf/vmtest-bpf-PR | success | PR summary |
netdev/tree_selection | success | Clearly marked for bpf |
netdev/fixes_present | success | Fixes tag present in non-next series |
netdev/subject_prefix | success | Link |
netdev/cover_letter | success | Series has a cover letter |
netdev/patch_count | success | Link |
netdev/header_inline | success | No static functions without inline keyword in header files |
netdev/build_32bit | success | Errors and warnings before: 27 this patch: 27 |
netdev/cc_maintainers | success | CCed 14 of 14 maintainers |
netdev/build_clang | success | Errors and warnings before: 22 this patch: 22 |
netdev/module_param | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Signed-off-by tag matches author and committer |
netdev/verify_fixes | success | Fixes tag looks correct |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 32 this patch: 32 |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 8 lines checked |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/source_inline | success | Was 0 now: 0 |
Maxim Mikityanskiy wrote: > Instead of querying the sk_ipv6only field directly, use the dedicated > ipv6_only_sock helper. > > Fixes: 70d66244317e ("bpf: add bpf_tcp_gen_syncookie helper") > Signed-off-by: Maxim Mikityanskiy <maximmi@nvidia.com> > Reviewed-by: Tariq Toukan <tariqt@nvidia.com> > --- Not really a fix, but LGTM. Acked-by: John Fastabend <john.fastabend@gmail.com>
On Mon, 24 Jan 2022 at 15:13, Maxim Mikityanskiy <maximmi@nvidia.com> wrote: > > Instead of querying the sk_ipv6only field directly, use the dedicated > ipv6_only_sock helper. > > Fixes: 70d66244317e ("bpf: add bpf_tcp_gen_syncookie helper") > Signed-off-by: Maxim Mikityanskiy <maximmi@nvidia.com> > Reviewed-by: Tariq Toukan <tariqt@nvidia.com> Acked-by: Lorenz Bauer <lmb@cloudflare.com>
On Wed, Jan 26, 2022 at 1:46 AM Lorenz Bauer <lmb@cloudflare.com> wrote: > > On Mon, 24 Jan 2022 at 15:13, Maxim Mikityanskiy <maximmi@nvidia.com> wrote: > > > > Instead of querying the sk_ipv6only field directly, use the dedicated > > ipv6_only_sock helper. > > > > Fixes: 70d66244317e ("bpf: add bpf_tcp_gen_syncookie helper") > > Signed-off-by: Maxim Mikityanskiy <maximmi@nvidia.com> > > Reviewed-by: Tariq Toukan <tariqt@nvidia.com> > > Acked-by: Lorenz Bauer <lmb@cloudflare.com> Acked-by: Petar Penkov <ppenkov@google.com>
diff --git a/net/core/filter.c b/net/core/filter.c index 4603b7cd3cd1..05efa691b796 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -6848,7 +6848,7 @@ BPF_CALL_5(bpf_tcp_gen_syncookie, struct sock *, sk, void *, iph, u32, iph_len, */ switch (((struct iphdr *)iph)->version) { case 4: - if (sk->sk_family == AF_INET6 && sk->sk_ipv6only) + if (sk->sk_family == AF_INET6 && ipv6_only_sock(sk)) return -EINVAL; mss = tcp_v4_get_syncookie(sk, iph, th, &cookie);