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: <20201201090331.469dd407@kicinski-fedora-pc1c0hjn.DHCP.thefacebook.com>
Date:   Tue, 1 Dec 2020 09:03:31 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     Vlad Buslov <vladbu@...dia.com>
Cc:     <davem@...emloft.net>, <netdev@...r.kernel.org>,
        <jhs@...atatu.com>, <xiyou.wangcong@...il.com>, <jiri@...nulli.us>
Subject: Re: [PATCH net-next] net: sched: remove redundant 'rtnl_held'
 argument

On Tue, 1 Dec 2020 09:55:37 +0200 Vlad Buslov wrote:
> On Tue 01 Dec 2020 at 04:52, Jakub Kicinski <kuba@...nel.org> wrote:
> > On Fri, 27 Nov 2020 17:12:05 +0200 Vlad Buslov wrote:  
> >> @@ -2262,7 +2260,7 @@ static int tc_del_tfilter(struct sk_buff *skb, struct nlmsghdr *n,
> >>  
> >>  	if (prio == 0) {
> >>  		tfilter_notify_chain(net, skb, block, q, parent, n,
> >> -				     chain, RTM_DELTFILTER, rtnl_held);
> >> +				     chain, RTM_DELTFILTER);
> >>  		tcf_chain_flush(chain, rtnl_held);
> >>  		err = 0;
> >>  		goto errout;  
> >
> > Hum. This looks off.  
> 
> Hi Jakub,
> 
> Prio==0 means user requests to flush whole chain. In such case rtnl lock
> is obtained earlier in tc_del_tfilter():
> 
> 	/* Take rtnl mutex if flushing whole chain, block is shared (no qdisc
> 	 * found), qdisc is not unlocked, classifier type is not specified,
> 	 * classifier is not unlocked.
> 	 */
> 	if (!prio ||
> 	    (q && !(q->ops->cl_ops->flags & QDISC_CLASS_OPS_DOIT_UNLOCKED)) ||
> 	    !tcf_proto_is_unlocked(name)) {
> 		rtnl_held = true;
> 		rtnl_lock();
> 	}
> 

Makes sense, although seems a little fragile. Why not put a true in
there, in that case?

Do you have a larger plan here? The motivation seems a little unclear
if I'm completely honest. Are you dropping the rtnl_held from all callers 
of __tcf_get_next_proto() just to save the extra argument / typing?
That's nice but there's also value in the API being consistent.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ