All of lore.kernel.org
 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] netrom: fix locking in nr_find_socket()
Date: Sun, 30 Dec 2018 20:24:59 -0800 (PST)	[thread overview]
Message-ID: <20181230.202459.1666665500046620349.davem@davemloft.net> (raw)
In-Reply-To: <20181229215638.10590-3-xiyou.wangcong@gmail.com>

From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Sat, 29 Dec 2018 13:56:38 -0800

> nr_find_socket(), nr_find_peer() and nr_find_listener() lock the
> sock after finding it in the global list. However, the call path
> requires BH disabled for the sock lock consistently.
> 
> Actually the locking is unnecessary at this point, we can just hold
> the sock refcnt to make sure it is not gone after we unlock the global
> list, and lock it later only when needed.
> 
> Reported-and-tested-by: syzbot+f621cda8b7e598908efa@syzkaller.appspotmail.com
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

Applied and queued up for -stable.

  reply	other threads:[~2018-12-31  4:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-29 21:56 [Patch net] ax25: fix a use-after-free in ax25_fillin_cb() Cong Wang
2018-12-29 21:56 ` [Patch net] net/wan: fix a double free in x25_asy_open_tty() Cong Wang
2018-12-31  4:23   ` David Miller
2018-12-29 21:56 ` [Patch net] netrom: fix locking in nr_find_socket() Cong Wang
2018-12-31  4:24   ` David Miller [this message]
2018-12-30 22:08 ` [Patch net] ax25: fix a use-after-free in ax25_fillin_cb() David Miller

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=20181230.202459.1666665500046620349.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.