[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zz-bFGXFE_hjeCYH@LQ3V64L9R2>
Date: Thu, 21 Nov 2024 12:41:56 -0800
From: Joe Damato <jdamato@...tly.com>
To: Eric Dumazet <edumazet@...gle.com>
Cc: "David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
netdev@...r.kernel.org, eric.dumazet@...il.com,
syzbot <syzkaller@...glegroups.com>,
Kuniyuki Iwashima <kuniyu@...zon.com>
Subject: Re: [PATCH net] rtnetlink: fix rtnl_dump_ifinfo() error path
On Thu, Nov 21, 2024 at 07:41:05PM +0000, Eric Dumazet wrote:
> syzbot found that rtnl_dump_ifinfo() could return with a lock held [1]
>
> Move code around so that rtnl_link_ops_put() and put_net()
> can be called at the end of this function.
>
> [1]
> WARNING: lock held when returning to user space!
> 6.12.0-rc7-syzkaller-01681-g38f83a57aa8e #0 Not tainted
> syz-executor399/5841 is leaving the kernel with locks still held!
> 1 lock held by syz-executor399/5841:
> #0: ffffffff8f46c2a0 (&ops->srcu#2){.+.+}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
> #0: ffffffff8f46c2a0 (&ops->srcu#2){.+.+}-{0:0}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline]
> #0: ffffffff8f46c2a0 (&ops->srcu#2){.+.+}-{0:0}, at: rtnl_link_ops_get+0x22/0x250 net/core/rtnetlink.c:555
>
> Fixes: 43c7ce69d28e ("rtnetlink: Protect struct rtnl_link_ops with SRCU.")
> Reported-by: syzbot <syzkaller@...glegroups.com>
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> Cc: Kuniyuki Iwashima <kuniyu@...zon.com>
Reviewed-by: Joe Damato <jdamato@...tly.com>
Powered by blists - more mailing lists