lkml.org 
[lkml]   [1998]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Fatal bug in Boomerang driver found
Date
From
Rob Riggs wrote:

> Bug #2 can affect any machine, but machines that have plenty of RAM
> are less likely to be affected. If the driver fails to replenish one
> of the skbs in the ring buffers (because DEV_ALLOC_SKB returned
> NULL) then the buffer will point to NULL (or 0x00). The driver does
> not test for a NULL skb and calls skb_put with a NULL value,
> generating a kernel panic. I beleive the correct solution here is to
> break from the read loop and try to replenish the ring buffer. There
> may be other issues involved here that I am not aware of, but Donald
> will need to check this out.

Ah. I've written a driver that simply holds a counter "I have so many
buffers in the ring". Instead of allocating a new one for every one
lost you replenish to the level you want at every occasion. (One
integer compare).

If the number of buffers drops to one, you stop passing the buffer
back to the networking layers. Instead you allocate a new buffer for
the data you just got (exactly the right size!) and copy the data
over. If your new buffer allocation fails, you simply drop the packet.
That means that your card can keep on putting stuff into ring buffers,
and everything becomes nice and dandy again as soon as the low-mem
situation clears up.


Roger.


--
Actor asks a collegue: "To what do you owe your success in acting?"
Answer: "Honesty. Once you've learned how to fake that, you've got it made."
-------- Custom Linux device drivers for sale! Call for a quote. ----------
Email: R.E.Wolff@BitWizard.nl || Tel: +31-15-2137555 || FAX: +31-15-2138217

--
Actor asks a collegue: "To what do you owe your success in acting?"
Answer: "Honesty. Once you've learned how to fake that, you've got it made."
-------- Custom Linux device drivers for sale! Call for a quote. ----------
Email: R.E.Wolff@BitWizard.nl || Tel: +31-15-2137555 || FAX: +31-15-2138217
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:43    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site