[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231013110638.GD29570@kernel.org>
Date: Fri, 13 Oct 2023 13:06:38 +0200
From: Simon Horman <horms@...nel.org>
To: Edward AD <twuufnxlz@...il.com>
Cc: syzbot+509238e523e032442b80@...kaller.appspotmail.com,
davem@...emloft.net, edumazet@...gle.com, johannes.berg@...el.com,
johannes@...solutions.net, kuba@...nel.org,
linux-kernel@...r.kernel.org, linux-wireless@...r.kernel.org,
netdev@...r.kernel.org, pabeni@...hat.com,
syzkaller-bugs@...glegroups.com
Subject: Re: [PATCH] rfkill: fix deadlock in rfkill_send_events
On Tue, Oct 10, 2023 at 09:08:15AM +0800, Edward AD wrote:
> syzbot report:
> syz-executor675/5132 is trying to acquire lock:
> ffff8880297ee088 (&data->mtx){+.+.}-{3:3}, at: rfkill_send_events+0x226/0x3f0 net/rfkill/core.c:286
>
> but task is already holding lock:
> ffff88801bfc0088 (&data->mtx){+.+.}-{3:3}, at: rfkill_fop_open+0x146/0x750 net/rfkill/core.c:1183
>
> other info that might help us debug this:
> Possible unsafe locking scenario:
>
> CPU0
> ----
> lock(&data->mtx);
> lock(&data->mtx);
>
> *** DEADLOCK ***
>
> In 2c3dfba4cf84 insert rfkill_sync() to rfkill_fop_open(), it will call
> rfkill_send_events() and then triger this issue.
>
> Fixes: 2c3dfba4cf84 ("rfkill: sync before userspace visibility/changes")
> Reported-and-tested-by: syzbot+509238e523e032442b80@...kaller.appspotmail.com
> Signed-off-by: Edward AD <twuufnxlz@...il.com>
Hi Edward,
I am wondering if you considered moving the rfkill_sync() calls
to before &data->mtx is taken, to avoid the need to drop and
retake it?
Perhaps it doesn't work for some reason (compile tested only!).
But this does seem somehow cleaner for me.
Powered by blists - more mailing lists