[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <403746c5-8c4a-02e6-cbb8-b43116ad9f18@ovn.org>
Date: Thu, 23 Jun 2022 13:48:46 +0200
From: Ilya Maximets <i.maximets@....org>
To: Eric Dumazet <edumazet@...gle.com>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>
Cc: i.maximets@....org, netdev@...r.kernel.org, eric.dumazet@...il.com,
Florian Westphal <fw@...len.de>,
Pablo Neira Ayuso <pablo@...filter.org>,
Steffen Klassert <steffen.klassert@...unet.com>
Subject: Re: [PATCH net] tcp: add a missing nf_reset_ct() in 3WHS handling
On 6/23/22 07:04, Eric Dumazet wrote:
> When the third packet of 3WHS connection establishment
> contains payload, it is added into socket receive queue
> without the XFRM check and the drop of connection tracking
> context.
>
> This means that if the data is left unread in the socket
> receive queue, conntrack module can not be unloaded.
>
> As most applications usually reads the incoming data
> immediately after accept(), bug has been hiding for
> quite a long time.
>
> Commit 68822bdf76f1 ("net: generalize skb freeing
> deferral to per-cpu lists") exposed this bug because
> even if the application reads this data, the skb
> with nfct state could stay in a per-cpu cache for
> an arbitrary time, if said cpu no longer process RX softirqs.
>
> Many thanks to Ilya Maximets for reporting this issue,
> and for testing various patches:
> https://lore.kernel.org/netdev/20220619003919.394622-1-i.maximets@ovn.org/
>
> Note that I also added a missing xfrm4_policy_check() call,
> although this is probably not a big issue, as the SYN
> packet should have been dropped earlier.
>
> Fixes: b59c270104f0 ("[NETFILTER]: Keep conntrack reference until IPsec policy checks are done")
> Reported-by: Ilya Maximets <i.maximets@....org>
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> Cc: Florian Westphal <fw@...len.de>
> Cc: Pablo Neira Ayuso <pablo@...filter.org>
> Cc: Steffen Klassert <steffen.klassert@...unet.com>
> ---
> net/ipv4/tcp_ipv4.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
Thanks! I re-tested this change with the OVS testsuite
and it works fine. It can successfully reload ntfilter
modules now. So, for the nf_reset_ct part of the fix:
Tested-by: Ilya Maximets <i.maximets@....org>
Reviewed-by: Ilya Maximets <i.maximets@....org>
XFRM part seems correct to me, but I didn't test it.
Powered by blists - more mailing lists