From: Greg KH <greg@kroah.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: stable@vger.kernel.org, edumazet@google.com,
netdev@vger.kernel.org, Ilya Maximets <i.maximets@ovn.org>,
Florian Westphal <fw@strlen.de>,
Pablo Neira Ayuso <pablo@netfilter.org>,
Steffen Klassert <steffen.klassert@secunet.com>
Subject: Re: [PATCH stable 5.15] tcp: add a missing nf_reset_ct() in 3WHS handling
Date: Mon, 4 Jul 2022 16:45:10 +0200 [thread overview]
Message-ID: <YsL89hdkaK9AOtDy@kroah.com> (raw)
In-Reply-To: <20220701014101.684813-1-kuba@kernel.org>
On Thu, Jun 30, 2022 at 06:41:01PM -0700, Jakub Kicinski wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> commit 6f0012e35160cd08a53e46e3b3bbf724b92dfe68 upstream.
>
> 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@ovn.org>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Florian Westphal <fw@strlen.de>
> Cc: Pablo Neira Ayuso <pablo@netfilter.org>
> Cc: Steffen Klassert <steffen.klassert@secunet.com>
> Tested-by: Ilya Maximets <i.maximets@ovn.org>
> Reviewed-by: Ilya Maximets <i.maximets@ovn.org>
> Link: https://lore.kernel.org/r/20220623050436.1290307-1-edumazet@google.com
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> net/ipv4/tcp_ipv4.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
Now queued up, thanks.
greg k-h
prev parent reply other threads:[~2022-07-04 14:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-01 1:41 [PATCH stable 5.15] tcp: add a missing nf_reset_ct() in 3WHS handling Jakub Kicinski
2022-07-04 14:45 ` Greg KH [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YsL89hdkaK9AOtDy@kroah.com \
--to=greg@kroah.com \
--cc=edumazet@google.com \
--cc=fw@strlen.de \
--cc=i.maximets@ovn.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=stable@vger.kernel.org \
--cc=steffen.klassert@secunet.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).