login
Header Space

 
 

Re: SFQ qdisc crashes with limit of 2 packets

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Chuck Ebbert <cebbert@...>
Cc: Netdev <netdev@...>, Alexey Kuznetsov <kuznet@...>
Date: Tuesday, September 18, 2007 - 3:15 pm

Patrick McHardy wrote:


OK the off-by-one prevents an out-of-bounds array access, which
would cause a crash itself. Despite what I said above, sfq does
try to handle dequeues while empty, but forgets to update q->tail
when dropping the last packet from the only active queue, probably
because it wasn't expected that the queue length is too small to
queue even a single packet (and that really doesn't make much sense).

So one possibility for fixing this is to update q->tail in sfq_drop
when dropping the last packet, but that would still leave the qdisc
non-functional because of the off-by-one. I chose a different way:
cap the limit at SFQ_DEPTH-1 and remove the off-by-one, which should
have no effect on the max (still 127), but prevents the crash since
we can now queue at least a single packet and q->tail is properly
updated in sfq_dequeue().

CCed Alexey just to be safe, but I think the patch should be fine.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
SFQ qdisc crashes with limit of 2 packets, Chuck Ebbert, (Tue Sep 18, 1:18 pm)
Re: SFQ qdisc crashes with limit of 2 packets, Patrick McHardy, (Tue Sep 18, 1:31 pm)
Re: SFQ qdisc crashes with limit of 2 packets, Patrick McHardy, (Tue Sep 18, 1:57 pm)
Re: SFQ qdisc crashes with limit of 2 packets, Patrick McHardy, (Tue Sep 18, 3:15 pm)
Re: SFQ qdisc crashes with limit of 2 packets, Alexey Kuznetsov, (Wed Sep 19, 5:48 am)
Re: SFQ qdisc crashes with limit of 2 packets, Patrick McHardy, (Wed Sep 19, 9:08 am)
Re: SFQ qdisc crashes with limit of 2 packets, Alexey Kuznetsov, (Fri Sep 21, 11:55 am)
Re: SFQ qdisc crashes with limit of 2 packets, David Miller, (Sun Sep 30, 8:51 pm)
Re: SFQ qdisc crashes with limit of 2 packets, David Miller, (Wed Sep 19, 1:43 pm)
Re: SFQ qdisc crashes with limit of 2 packets, David Miller, (Tue Sep 18, 4:09 pm)
speck-geostationary