From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>, Jarek Poplawski <jarkao2@gmail.com>
Subject: [PATCH net-next-2.6] sfq: fix slot_dequeue_head()
Date: Thu, 30 Dec 2010 16:02:48 +0100 [thread overview]
Message-ID: <1293721368.7150.307.camel@edumazet-laptop> (raw)
In-Reply-To: <20101222073211.GA7001@ff.dom.local>
Le mercredi 22 décembre 2010 à 07:32 +0000, Jarek Poplawski a écrit :
> > Also, slot_dequeue_tail() should make sure slot skb chain is correctly
> > terminated, or sfq_dump_class_stats() can access freed skbs.
>
> ...and a good hint for code reusing ;-)
Yes, and of course same fix is needed in slot_dequeue_head(), as further
testing on my side made it pretty clear.
I was adding possibility to have more packets queued in SFQ (more
packets than max number of flows) and got unexpected crashes.
Reverting to net-next-2.6, I still got crashes. Oops.
[PATCH net-next-2.6] sfq: fix slot_dequeue_head()
slot_dequeue_head() should make sure slot skb chain is correct in both
ways, or we can crash if all possible flows are in use.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Jarek Poplawski <jarkao2@gmail.com>
---
net/sched/sch_sfq.c | 1 +
1 files changed, 1 insertion(+)
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
index 6a2f88f..3977e56 100644
--- a/net/sched/sch_sfq.c
+++ b/net/sched/sch_sfq.c
@@ -292,6 +292,7 @@ static inline struct sk_buff *slot_dequeue_head(struct sfq_slot *slot)
struct sk_buff *skb = slot->skblist_next;
slot->skblist_next = skb->next;
+ skb->next->prev = (struct sk_buff *)slot;
skb->next = skb->prev = NULL;
return skb;
}
next prev parent reply other threads:[~2010-12-30 15:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-22 6:14 [PATCH net-next-2.6] sfq: fix sfq stats handling Eric Dumazet
2010-12-22 7:32 ` Jarek Poplawski
2010-12-30 15:02 ` Eric Dumazet [this message]
2010-12-30 17:49 ` [PATCH net-next-2.6] sfq: fix slot_dequeue_head() Jarek Poplawski
2010-12-30 21:31 ` Eric Dumazet
2010-12-31 20:49 ` David Miller
2010-12-22 19:39 ` [PATCH net-next-2.6] sfq: fix sfq stats handling David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1293721368.7150.307.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=jarkao2@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox