From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: Daniel Borkmann <daniel@iogearbox.net>,
David Miller <davem@davemloft.net>
Cc: eric.dumazet@gmail.com, alexei.starovoitov@gmail.com,
mkubecek@suse.cz, sasha.levin@oracle.com, jslaby@suse.cz,
mst@redhat.com, netdev@vger.kernel.org
Subject: Re: [PATCH net] tun, bpf: fix suspicious RCU usage in tun_{attach,detach}_filter
Date: Fri, 1 Apr 2016 01:31:52 +0200 [thread overview]
Message-ID: <56FDB368.3000108@stressinduktion.org> (raw)
In-Reply-To: <56FD9C39.6040703@iogearbox.net>
Hi Daniel,
On 31.03.2016 23:52, Daniel Borkmann wrote:
> On 03/31/2016 09:48 PM, Hannes Frederic Sowa wrote:
> [...]
>> Tightest solution would probably be to combine both patches.
>>
>> bool called_by_tuntap;
>>
>> old_fp = rcu_dereference_protected(sk->sk_filter, called_by_tuntap ?
>> lockdep_rtnl_is_held() : lockdep_sock_is_held());
>
> If I understand you correctly with combining them, you mean you'd still
> need the API change to pass the bool 'called_by_tuntap' down, right?
I actually decided to simply lock the sockets. So that there will always
be a clear lock owner during the updates. I think this is cleaner. What
do you think?
> If so, your main difference is, after all, to replace the
> sock_owned_by_user()
> with the lockdep_sock_is_held() construction instead, correct?
I just didn't do that part because we hold socket lock now.
> But then, isn't it already sufficient when you pass the bool itself down
> that 'demuxes' in this case between the sock_owned_by_user() vs
> lockdep_rtnl_is_held() check?
I just send out the patches, please have a look.
Thanks,
Hannes
next prev parent reply other threads:[~2016-03-31 23:31 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-31 0:13 [PATCH net] tun, bpf: fix suspicious RCU usage in tun_{attach,detach}_filter Daniel Borkmann
2016-03-31 1:18 ` Alexei Starovoitov
2016-03-31 5:01 ` Michal Kubecek
2016-03-31 5:08 ` Alexei Starovoitov
2016-03-31 5:22 ` Michal Kubecek
2016-03-31 5:43 ` Alexei Starovoitov
2016-03-31 11:35 ` Daniel Borkmann
2016-03-31 11:59 ` Eric Dumazet
2016-03-31 12:16 ` Daniel Borkmann
2016-03-31 19:21 ` David Miller
2016-03-31 19:24 ` Hannes Frederic Sowa
2016-03-31 19:31 ` Alexei Starovoitov
2016-03-31 19:48 ` David Miller
2016-03-31 19:36 ` David Miller
2016-03-31 19:48 ` Hannes Frederic Sowa
2016-03-31 19:50 ` David Miller
2016-03-31 21:52 ` Daniel Borkmann
2016-03-31 23:31 ` Hannes Frederic Sowa [this message]
2016-03-31 12:12 ` Hannes Frederic Sowa
2016-03-31 9:15 ` Jiri Slaby
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=56FDB368.3000108@stressinduktion.org \
--to=hannes@stressinduktion.org \
--cc=alexei.starovoitov@gmail.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=jslaby@suse.cz \
--cc=mkubecek@suse.cz \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=sasha.levin@oracle.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).