public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: Saeed Mahameed <saeed@kernel.org>
Cc: netdev@vger.kernel.org, g.nault@alphalink.fr,
	Cong Wang <cong.wang@bytedance.com>,
	syzbot+52866e24647f9a23403f@syzkaller.appspotmail.com,
	syzbot+94cc2a66fc228b23f360@syzkaller.appspotmail.com,
	Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	Jakub Sitnicki <jakub@cloudflare.com>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [Patch net 2/2] l2tp: close all race conditions in l2tp_tunnel_register()
Date: Sat, 7 Jan 2023 11:52:23 -0800	[thread overview]
Message-ID: <Y7nNdx1yDoEEPrwY@pop-os.localdomain> (raw)
In-Reply-To: <Y7m85XdeKwi9+Ytt@x130>

On Sat, Jan 07, 2023 at 10:41:41AM -0800, Saeed Mahameed wrote:
> On 05 Jan 11:13, Cong Wang wrote:
> > From: Cong Wang <cong.wang@bytedance.com>
> > 
> > The code in l2tp_tunnel_register() is racy in several ways:
> > 
> > 1. It modifies the tunnel socket _after_ publishing it.
> > 
> > 2. It calls setup_udp_tunnel_sock() on an existing socket without
> >   locking.
> > 
> > 3. It changes sock lock class on fly, which triggers many syzbot
> >   reports.
> > 
> > This patch amends all of them by moving socket initialization code
> > before publishing and under sock lock. As suggested by Jakub, the
> > l2tp lockdep class is not necessary as we can just switch to
> > bh_lock_sock_nested().
> > 
> > Fixes: 37159ef2c1ae ("l2tp: fix a lockdep splat")
> > Fixes: 6b9f34239b00 ("l2tp: fix races in tunnel creation")
> 
> This patch relies on the previous one which doesn't include any tags.
> If you are interested in this making it to -stable then maybe you need to
> add those tags to the previous commit ?
> 

But technically patch 1/2 does not fix anything alone, this is why I
heisitate to add any Fixes tag to it.

Since this is a patchset, I think maintainers can easily figure out this
is a whole set.

Thanks.

  reply	other threads:[~2023-01-07 19:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-05 19:13 [Patch net 0/2] l2tp: fix race conditions in l2tp_tunnel_register() Cong Wang
2023-01-05 19:13 ` [Patch net 1/2] l2tp: convert l2tp_tunnel_list to idr Cong Wang
2023-01-07 18:25   ` Saeed Mahameed
2023-01-07 19:48     ` Cong Wang
2023-01-07 19:48   ` Guillaume Nault
2023-01-09  9:55     ` Tom Parkin
2023-01-10  6:49     ` Cong Wang
2023-01-05 19:13 ` [Patch net 2/2] l2tp: close all race conditions in l2tp_tunnel_register() Cong Wang
2023-01-07 18:41   ` Saeed Mahameed
2023-01-07 19:52     ` Cong Wang [this message]
2023-01-10  1:36       ` Jakub Kicinski

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=Y7nNdx1yDoEEPrwY@pop-os.localdomain \
    --to=xiyou.wangcong@gmail.com \
    --cc=cong.wang@bytedance.com \
    --cc=edumazet@google.com \
    --cc=g.nault@alphalink.fr \
    --cc=jakub@cloudflare.com \
    --cc=netdev@vger.kernel.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=saeed@kernel.org \
    --cc=syzbot+52866e24647f9a23403f@syzkaller.appspotmail.com \
    --cc=syzbot+94cc2a66fc228b23f360@syzkaller.appspotmail.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