pkt_sched: Fix OOPS on ingress qdisc add.

Previous thread: ipv6: Fix useless proc net sockstat6 removal by Linux Kernel Mailing List on Wednesday, July 30, 2008 - 12:06 pm. (1 message)

Next thread: tcp: MD5: Use MIB counter instead of warning for MD5 mismatch. by Linux Kernel Mailing List on Wednesday, July 30, 2008 - 12:06 pm. (1 message)
From: Linux Kernel Mailing List
Date: Wednesday, July 30, 2008 - 12:06 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8d50b5...
Commit:     8d50b53d66a8a6ae41bafbdcabe401467803f33a
Parent:     38c080ffa9c1b840390832b42ce8621464ab9f97
Author:     David S. Miller <davem@davemloft.net>
AuthorDate: Wed Jul 30 02:37:46 2008 -0700
Committer:  David S. Miller <davem@davemloft.net>
CommitDate: Wed Jul 30 02:44:25 2008 -0700

    pkt_sched: Fix OOPS on ingress qdisc add.
    
    Bug report from Steven Jan Springl:
    
    	Issuing the following command causes a kernel oops:
    		tc qdisc add dev eth0 handle ffff: ingress
    
    The problem mostly stems from all of the special case handling of
    ingress qdiscs.
    
    So, to fix this, do the grafting operation the same way we do for TX
    qdiscs.  Which means that dev_activate() and dev_deactivate() now do
    the "qdisc_sleeping <--> qdisc" transitions on dev->rx_queue too.
    
    Future simplifications are possible now, mainly because it is
    impossible for dev_queue->{qdisc,qdisc_sleeping} to be NULL.  There
    are NULL checks all over to handle the ingress qdisc special case
    that used to exist before this commit.
    
    Signed-off-by: David S. Miller <davem@davemloft.net>
---
 net/core/dev.c          |    4 +-
 net/sched/sch_api.c     |   57 +++++++++++++---------------------------------
 net/sched/sch_generic.c |    8 ++++--
 3 files changed, 23 insertions(+), 46 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 8d13a9b..63d6bcd 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2100,7 +2100,7 @@ static int ing_filter(struct sk_buff *skb)
 	rxq = &dev->rx_queue;
 
 	q = rxq->qdisc;
-	if (q) {
+	if (q != &noop_qdisc) {
 		spin_lock(qdisc_lock(q));
 		result = qdisc_enqueue_root(skb, q);
 		spin_unlock(qdisc_lock(q));
@@ -2113,7 +2113,7 @@ static inline struct sk_buff *handle_ing(struct sk_buff *skb,
 					 struct packet_type **pt_prev,
 					 int *ret, struct net_device ...
Previous thread: ipv6: Fix useless proc net sockstat6 removal by Linux Kernel Mailing List on Wednesday, July 30, 2008 - 12:06 pm. (1 message)

Next thread: tcp: MD5: Use MIB counter instead of warning for MD5 mismatch. by Linux Kernel Mailing List on Wednesday, July 30, 2008 - 12:06 pm. (1 message)