Re: [PATCH V2] ax25: Fix potential deadlock on &ax25_list_lock

From: Simon Horman
Date: Mon Oct 09 2023 - 10:56:09 EST


On Sat, Oct 07, 2023 at 11:43:59PM +0800, Chengfeng Ye wrote:
> Hi Simon Horman,
>
> I think maybe not. My static analysis tool only reported this function, I
> also just manually checked the spin_lock(&ax25_list_lock) in other
> functions, and it looks like they are basically under rcv callback or timer,
> which already have BH disabled. I think the developers who wrote
> the code should be aware of this so they used spin_lock() instead of
> spin_lock_bh().
>
> But the fixed function is a bit different, as it could be called from .ioctl(),
> which is from userland syscall and executes under the process
> context, and along the call chain BH is also not disabled explicitly. That's
> the reason why only at this place I change to spin_lock_bh().

Thanks,

I agree that seems to be the case.

Reviewed-by: Simon Horman <horms@xxxxxxxxxx>