lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHA+R7Nx3P4i8=EQ_6nGvi5MhEXxMUvY=nBYf0vuKcOxAud2kg@mail.gmail.com>
Date:	Wed, 20 May 2015 11:30:39 -0700
From:	Cong Wang <cwang@...pensource.com>
To:	Daniel Borkmann <daniel@...earbox.net>
Cc:	David Miller <davem@...emloft.net>, subramanian.vijay@...il.com,
	netdev <netdev@...r.kernel.org>,
	John Fastabend <john.r.fastabend@...el.com>,
	Eric Dumazet <edumazet@...gle.com>,
	Thomas Graf <tgraf@...g.ch>,
	Jamal Hadi Salim <jhs@...atatu.com>,
	Alexei Starovoitov <ast@...mgrid.com>
Subject: Re: [PATCH net] net: sched: fix call_rcu() race on classifier module unloads

On Wed, May 20, 2015 at 11:12 AM, Daniel Borkmann <daniel@...earbox.net> wrote:
> On 05/20/2015 07:38 PM, Cong Wang wrote:
> ...
>>
>> Why synchronize_rcu() even matters here? It waits for
>> readers, not for RCU callbacks.
>
>
> Hm, I am mentioning it here as it was related to 78fd1d0ab072
> as explained in the commit message.


Move it to the right place or remove it, it is only confusing.


>
>>> Since we came here via unregister_tcf_proto_ops(), there
>>> are no users of a given classifier anymore. Further nested
>>> call_rcu()s pointing into the module space are not being
>>> done anywhere.
>>
>>
>> This doesn't look like the best way to fix it, since calling
>> call_rcu() is tc filter specific, so why not just move the
>> rcu_barrier() to each of the ->destroy() implementation?
>> Let each filter handle its own implementation bug.
>
>
> Effectively, every in-tree classifier (rsvp is the only exception)
> is making use of call_rcu(). Moreover, moving this into every
> ->destroy() handler would also be unnecessary overhead, imho, as
> this is only relevant when we actually _unload_ a module.

Well, ->destroy() is not a fast path, it holds rtnl lock, we don't want to
lose readability for little performance gain. The code is hard to
understand even with a comment there, move it to tcf_destroy() so
that we probably don't even need a comment there.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ