[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y8UwJkRY1ISej+Zu@debian>
Date: Mon, 16 Jan 2023 12:08:22 +0100
From: Guillaume Nault <gnault@...hat.com>
To: Cong Wang <xiyou.wangcong@...il.com>
Cc: netdev@...r.kernel.org, saeed@...nel.org, tparkin@...alix.com,
Cong Wang <cong.wang@...edance.com>,
syzbot+52866e24647f9a23403f@...kaller.appspotmail.com,
syzbot+94cc2a66fc228b23f360@...kaller.appspotmail.com,
Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>,
Jakub Sitnicki <jakub@...udflare.com>,
Eric Dumazet <edumazet@...gle.com>
Subject: Re: [Patch net v3 2/2] l2tp: close all race conditions in
l2tp_tunnel_register()
On Fri, Jan 13, 2023 at 07:01:37PM -0800, Cong Wang wrote:
> From: Cong Wang <cong.wang@...edance.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().
Reviewed-by: Guillaume Nault <gnault@...hat.com>
Powered by blists - more mailing lists