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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080811222511.GC15293@ami.dom.local>
Date:	Tue, 12 Aug 2008 00:25:11 +0200
From:	Jarek Poplawski <jarkao2@...il.com>
To:	David Miller <davem@...emloft.net>
Cc:	netdev@...r.kernel.org
Subject: [PATCH alternative] pkt_sched: Move qdisc_put_stab() from BH
	context.

On Mon, Aug 11, 2008 at 11:42:39PM +0200, Jarek Poplawski wrote:
> 
> pkt_sched: Add BH protection for qdisc_stab_lock.

...Or instead of this:
-------------> (alternative version)

pkt_sched: Move qdisc_put_stab() from BH context.

Since qdisc_stab_lock is used in qdisc_put_stab(), which is called in
BH context from __qdisc_destroy() RCU callback, softirq safe locking
should be used. Alternatively we can move this to qdisc_destroy(). 


Signed-off-by: Jarek Poplawski <jarkao2@...il.com>

---
(Apply on top of: pkt_sched: Destroy gen estimator under rtnl_lock().)

diff -Nurp a/net/sched/sch_generic.c b/net/sched/sch_generic.c
--- a/net/sched/sch_generic.c	2008-08-12 00:04:22.000000000 +0200
+++ b/net/sched/sch_generic.c	2008-08-12 00:08:24.000000000 +0200
@@ -525,9 +525,6 @@ static void __qdisc_destroy(struct rcu_h
 {
 	struct Qdisc *qdisc = container_of(head, struct Qdisc, q_rcu);
 
-#ifdef CONFIG_NET_SCHED
-	qdisc_put_stab(qdisc->stab);
-#endif
 	dev_put(qdisc_dev(qdisc));
 
 	kfree_skb(qdisc->gso_skb);
@@ -548,6 +545,9 @@ void qdisc_destroy(struct Qdisc *qdisc)
 	if (qdisc->parent)
 		list_del(&qdisc->list);
 
+#ifdef CONFIG_NET_SCHED
+	qdisc_put_stab(qdisc->stab);
+#endif
 	gen_kill_estimator(&qdisc->bstats, &qdisc->rate_est);
 	if (ops->reset)
 		ops->reset(qdisc);
--
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