On 04/03/2019 05:51 PM, Li RongQing wrote:
> ax25_rt_autobind is always called in user context, so lock_sock_fast
> should be used, and bh_lock_sock should only be used in BH context
> this replacement fixes a possible deadlock
> 


> 
> Reported-by: [email protected]
> Signed-off-by: Li RongQing <[email protected]>
> ---
>  net/ax25/ax25_route.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/net/ax25/ax25_route.c b/net/ax25/ax25_route.c
> index 66f74c85cf6b..28e21259ff08 100644
> --- a/net/ax25/ax25_route.c
> +++ b/net/ax25/ax25_route.c
> @@ -429,9 +429,11 @@ int ax25_rt_autobind(ax25_cb *ax25, ax25_address *addr)
>       }
>  
>       if (ax25->sk != NULL) {
> -             bh_lock_sock(ax25->sk);
> +             bool slow;
> +
> +             slow = lock_sock_fast(ax25->sk);
>               sock_reset_flag(ax25->sk, SOCK_ZAPPED);
> -             bh_unlock_sock(ax25->sk);
> +             unlock_sock_fast(ax25->sk, slow);
>       }
>  
>  put:
> 

How have you tested this patch exactly ?

Reply via email to