netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: jakub@cloudflare.com
Cc: netdev@vger.kernel.org, john.fastabend@gmail.com,
	syzbot+d73682fcf7fee6982fe3@syzkaller.appspotmail.com
Subject: Re: [PATCH net] net, sk_msg: Don't check if sock is locked when tearing down psock
Date: Wed, 22 Jan 2020 20:30:37 +0100 (CET)	[thread overview]
Message-ID: <20200122.203037.138201907865382075.davem@davemloft.net> (raw)
In-Reply-To: <20200121123147.706666-1-jakub@cloudflare.com>

From: Jakub Sitnicki <jakub@cloudflare.com>
Date: Tue, 21 Jan 2020 13:31:47 +0100

> As John Fastabend reports [0], psock state tear-down can happen on receive
> path *after* unlocking the socket, if the only other psock user, that is
> sockmap or sockhash, releases its psock reference before tcp_bpf_recvmsg
> does so:
> 
>  tcp_bpf_recvmsg()
>   psock = sk_psock_get(sk)                         <- refcnt 2
>   lock_sock(sk);
>   ...
>                                   sock_map_free()  <- refcnt 1
>   release_sock(sk)
>   sk_psock_put()                                   <- refcnt 0
> 
> Remove the lockdep check for socket lock in psock tear-down that got
> introduced in 7e81a3530206 ("bpf: Sockmap, ensure sock lock held during
> tear down").
> 
> [0] https://lore.kernel.org/netdev/5e25dc995d7d_74082aaee6e465b441@john-XPS-13-9370.notmuch/
> 
> Fixes: 7e81a3530206 ("bpf: Sockmap, ensure sock lock held during tear down")
> Reported-by: syzbot+d73682fcf7fee6982fe3@syzkaller.appspotmail.com
> Suggested-by: John Fastabend <john.fastabend@gmail.com>
> Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>

Applied, thank you.

      parent reply	other threads:[~2020-01-22 19:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-21 12:31 [PATCH net] net, sk_msg: Don't check if sock is locked when tearing down psock Jakub Sitnicki
2020-01-22 17:53 ` John Fastabend
2020-01-22 17:59 ` Daniel Borkmann
2020-01-22 19:30 ` 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=20200122.203037.138201907865382075.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=jakub@cloudflare.com \
    --cc=john.fastabend@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=syzbot+d73682fcf7fee6982fe3@syzkaller.appspotmail.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).