linux-hams.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Li RongQing <lirongqing@baidu.com>,
	ralf@linux-mips.org, linux-hams@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH] net: ax25: replace bh_lock_sock with lock_sock_fast in ax25_rt_autobind
Date: Wed, 3 Apr 2019 20:51:53 -0700	[thread overview]
Message-ID: <c5f89148-0d0a-f81c-5d0d-b631c36196ca@gmail.com> (raw)
In-Reply-To: <1554339063-28712-1-git-send-email-lirongqing@baidu.com>



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: syzbot+e350b81e95a6a214da8a@syzkaller.appspotmail.com
> Signed-off-by: Li RongQing <lirongqing@baidu.com>
> ---
>  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	other threads:[~2019-04-04  3:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-04  0:51 [PATCH] net: ax25: replace bh_lock_sock with lock_sock_fast in ax25_rt_autobind Li RongQing
2019-04-04  3:51 ` Eric Dumazet [this message]
2019-04-04  6:13   ` 答复: " Li,Rongqing

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c5f89148-0d0a-f81c-5d0d-b631c36196ca@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=linux-hams@vger.kernel.org \
    --cc=lirongqing@baidu.com \
    --cc=netdev@vger.kernel.org \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).