netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: xiyou.wangcong@gmail.com
Cc: netdev@vger.kernel.org
Subject: Re: [Patch net] llc: hold llc_sap before release_sock()
Date: Thu, 19 Apr 2018 13:54:40 -0400 (EDT)	[thread overview]
Message-ID: <20180419.135440.1073794971834587664.davem@davemloft.net> (raw)
In-Reply-To: <20180418185156.27067-1-xiyou.wangcong@gmail.com>

From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Wed, 18 Apr 2018 11:51:56 -0700

> @@ -199,9 +200,15 @@ static int llc_ui_release(struct socket *sock)
>  		llc->laddr.lsap, llc->daddr.lsap);
>  	if (!llc_send_disc(sk))
>  		llc_ui_wait_for_disc(sk, sk->sk_rcvtimeo);
> +	sap = llc->sap;
> +	/* Hold this for release_sock(), so that llc_backlog_rcv() could still
> +	 * use it.
> +	 */
> +	llc_sap_hold(sap);
>  	if (!sock_flag(sk, SOCK_ZAPPED))
>  		llc_sap_remove_socket(llc->sap, sk);
>  	release_sock(sk);
> +	llc_sap_put(sap);
>  	if (llc->dev)
>  		dev_put(llc->dev);
>  	sock_put(sk);

Yeah, kind of a weird ordering issue here.  It would have been nice if we could
remove the sap after the release_sock() but it appears that we can't.

Applied and queued up for -stable, thanks.

      reply	other threads:[~2018-04-19 17:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-18 18:51 [Patch net] llc: hold llc_sap before release_sock() Cong Wang
2018-04-19 17:54 ` David Miller [this message]

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=20180419.135440.1073794971834587664.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=xiyou.wangcong@gmail.com \
    /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).