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]
Date:	Fri, 07 Mar 2014 17:04:50 -0500 (EST)
From:	David Miller <davem@...emloft.net>
To:	eric.dumazet@...il.com
Cc:	netdev@...r.kernel.org
Subject: Re: [PATCH] pkt_sched: fq: do not hold qdisc lock while allocating
 memory

From: Eric Dumazet <eric.dumazet@...il.com>
Date: Thu, 06 Mar 2014 22:57:52 -0800

> From: Eric Dumazet <edumazet@...gle.com>
> 
> Resizing fq hash table allocates memory while holding qdisc spinlock,
> with BH disabled.
> 
> This is definitely not good, as allocation might sleep.
> 
> We can drop the lock and get it when needed, we hold RTNL so no other
> changes can happen at the same time.
> 
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> Fixes: afe4fd062416 ("pkt_sched: fq: Fair Queue packet scheduler")

Eric I think you can simplify things a little further, and in fact I
think it makes these functions easier to understand.

The fq_resize() part should just grab the lock around the rehash and
the update of q->fq_root and q->fq_trees_log.

fq_change() should only grab the lock around the fq_dequeue() loop
and the call to qdisc_tree_descrease_qlen().  The rest of this
function is just validating netlink attributes and looking at state
that cannot change while we hold RTNL.
--
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