diff options
author | Ilya Leoshkevich <iii@linux.ibm.com> | 2023-08-30 03:07:43 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-09-15 10:17:55 -0700 |
commit | 837723b22a63cfbff584655b009b9d488d0e9087 (patch) | |
tree | 13204f6b4dd3285d6c4704e11a5c8a0e1505a062 /kernel | |
parent | 8a19edd4fa6f5b22d5a35bb7c8bb3e7c571a74d4 (diff) |
netfilter, bpf: Adjust timeouts of non-confirmed CTs in bpf_ct_insert_entry()
bpf_nf testcase fails on s390x: bpf_skb_ct_lookup() cannot find the entry
that was added by bpf_ct_insert_entry() within the same BPF function.
The reason is that this entry is deleted by nf_ct_gc_expired().
The CT timeout starts ticking after the CT confirmation; therefore
nf_conn.timeout is initially set to the timeout value, and
__nf_conntrack_confirm() sets it to the deadline value.
bpf_ct_insert_entry() sets IPS_CONFIRMED_BIT, but does not adjust the
timeout, making its value meaningless and causing false positives.
Fix the problem by making bpf_ct_insert_entry() adjust the timeout,
like __nf_conntrack_confirm().
Fixes: 2cdaa3eefed8 ("netfilter: conntrack: restore IPS_CONFIRMED out of nf_conntrack_hash_check_insert()")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Florian Westphal <fw@strlen.de>
Link: https://lore.kernel.org/bpf/20230830011128.1415752-3-iii@linux.ibm.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions