[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231007151021.GC831234@kernel.org>
Date: Sat, 7 Oct 2023 17:10:21 +0200
From: Simon Horman <horms@...nel.org>
To: Chengfeng Ye <dg573847474@...il.com>
Cc: jreuter@...na.de, ralf@...ux-mips.org, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
linux-hams@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH V2] ax25: Fix potential deadlock on &ax25_list_lock
On Thu, Oct 05, 2023 at 07:23:49AM +0000, Chengfeng Ye wrote:
> Timer interrupt ax25_ds_timeout() could introduce double locks on
> &ax25_list_lock.
>
> ax25_ioctl()
> --> ax25_ctl_ioctl()
> --> ax25_dama_off()
> --> ax25_dev_dama_off()
> --> ax25_check_dama_slave()
> --> spin_lock(&ax25_list_lock)
> <timer interrupt>
> --> ax25_ds_timeout()
> --> spin_lock(&ax25_list_lock)
>
> This flaw was found by an experimental static analysis tool I am
> developing for irq-related deadlock.
>
> To prevent the potential deadlock, the patch use spin_lock_bh()
> on &ax25_list_lock inside ax25_check_dama_slave().
>
> Fixes: c19c4b9c9acb ("[AX.25]: Optimize AX.25 socket list lock")
> Signed-off-by: Chengfeng Ye <dg573847474@...il.com>
Hi Chengfeng Ye,
Are there other functions that spin_lock(&ax25_list_lock)
that also need to use spin_lock_bh()?
...
Powered by blists - more mailing lists