[PATCH] Olympic driver bug fix

Mike Phillips (mikep@linuxtr.net)
Thu, 1 Nov 2001 11:36:21 -0600 (CST)


It is possible to panic the kernel with the olympic driver by setting the
mtu to a low value. This bug only surfaced after the fix to stop pkacets
being dropped by the socket code.

Simply one liner, patch is against 2.4.13.

Please apply, thanks

Mike Phillips
Linux Token Ring Project
http://www.linuxtr.net

--- linux.orig/drivers/net/tokenring/olympic.c.orig Fri Oct 12 08:39:43 2001
+++ linux-2.4.13/drivers/net/tokenring/olympic.c Fri Oct 12 08:47:20 2001
@@ -737,7 +737,7 @@
} else {

if (buffer_cnt == 1) {
- skb = dev_alloc_skb(olympic_priv->pkt_buf_sz) ;
+ skb = dev_alloc_skb(max_t(int, olympic_priv->pkt_buf_sz,length)) ;
} else {
skb = dev_alloc_skb(length) ;
}
@@ -1722,4 +1722,4 @@
module_init(olympic_pci_init) ;
module_exit(olympic_pci_cleanup) ;

-MODULE_LICENSE("GPL");
\ No newline at end of file
+MODULE_LICENSE("GPL");

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/