* [PATCH] USB speedtouch: discard packets for non-existant vcc's
@ 2003-04-12 11:49 Duncan Sands
2003-04-15 5:35 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Duncan Sands @ 2003-04-12 11:49 UTC (permalink / raw)
To: linux-usb-devel; +Cc: Greg KH, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1151 bytes --]
I broke part of the udsl_decode_rawcell logic in a previous patch, leading to
possible hangs on startup/shutdown. I've attached the 2.4 and 2.5 versions.
Thanks to Subodh Srivastava and Ted Phelps for their bug reports. Here is the
2.5 patch included inline for reference:
--- redux-2.5/drivers/usb/misc/speedtch.c 2003-04-12 11:29:03.000000000 +0200
+++ bollux-2.5/drivers/usb/misc/speedtch.c 2003-04-12 13:35:57.000000000 +0200
@@ -278,9 +278,10 @@
/* here should the header CRC check be... */
- if (!(vcc = udsl_find_vcc (instance, vpi, vci)))
+ if (!(vcc = udsl_find_vcc (instance, vpi, vci))) {
dbg ("udsl_decode_rawcell: no vcc found for packet on vpi %d, vci %d", vpi, vci);
- else {
+ __skb_pull (skb, min (skb->len, (unsigned) 53));
+ } else {
dbg ("udsl_decode_rawcell found vcc %p for packet on vpi %d, vci %d", vcc, vpi, vci);
if (skb->len >= 53) {
@@ -323,8 +324,8 @@
skb_pull (skb, 53);
} else {
/* If data is corrupt and skb doesn't hold a whole cell, flush the lot */
- if (skb_pull (skb, 53) == NULL)
- return NULL;
+ __skb_pull (skb, skb->len);
+ return NULL;
}
}
}
[-- Attachment #2: patch-2.4.diff --]
[-- Type: text/x-diff, Size: 868 bytes --]
--- redux-2.4/drivers/usb/speedtouch.c 2003-04-12 11:23:46.000000000 +0200
+++ bollux-2.4/drivers/usb/speedtouch.c 2003-04-12 11:19:25.000000000 +0200
@@ -278,9 +278,10 @@
/* here should the header CRC check be... */
- if (!(vcc = udsl_find_vcc (instance, vpi, vci)))
+ if (!(vcc = udsl_find_vcc (instance, vpi, vci))) {
dbg ("udsl_decode_rawcell: no vcc found for packet on vpi %d, vci %d", vpi, vci);
- else {
+ __skb_pull (skb, min (skb->len, (unsigned) 53));
+ } else {
dbg ("udsl_decode_rawcell found vcc %p for packet on vpi %d, vci %d", vcc, vpi, vci);
if (skb->len >= 53) {
@@ -323,8 +324,8 @@
skb_pull (skb, 53);
} else {
/* If data is corrupt and skb doesn't hold a whole cell, flush the lot */
- if (skb_pull (skb, 53) == NULL)
- return NULL;
+ __skb_pull (skb, skb->len);
+ return NULL;
}
}
}
[-- Attachment #3: patch-2.5.diff --]
[-- Type: text/x-diff, Size: 874 bytes --]
--- redux-2.5/drivers/usb/misc/speedtch.c 2003-04-12 11:29:03.000000000 +0200
+++ bollux-2.5/drivers/usb/misc/speedtch.c 2003-04-12 13:35:57.000000000 +0200
@@ -278,9 +278,10 @@
/* here should the header CRC check be... */
- if (!(vcc = udsl_find_vcc (instance, vpi, vci)))
+ if (!(vcc = udsl_find_vcc (instance, vpi, vci))) {
dbg ("udsl_decode_rawcell: no vcc found for packet on vpi %d, vci %d", vpi, vci);
- else {
+ __skb_pull (skb, min (skb->len, (unsigned) 53));
+ } else {
dbg ("udsl_decode_rawcell found vcc %p for packet on vpi %d, vci %d", vcc, vpi, vci);
if (skb->len >= 53) {
@@ -323,8 +324,8 @@
skb_pull (skb, 53);
} else {
/* If data is corrupt and skb doesn't hold a whole cell, flush the lot */
- if (skb_pull (skb, 53) == NULL)
- return NULL;
+ __skb_pull (skb, skb->len);
+ return NULL;
}
}
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] USB speedtouch: discard packets for non-existant vcc's
2003-04-12 11:49 [PATCH] USB speedtouch: discard packets for non-existant vcc's Duncan Sands
@ 2003-04-15 5:35 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2003-04-15 5:35 UTC (permalink / raw)
To: Duncan Sands; +Cc: linux-usb-devel, linux-kernel
On Sat, Apr 12, 2003 at 01:49:39PM +0200, Duncan Sands wrote:
> I broke part of the udsl_decode_rawcell logic in a previous patch, leading to
> possible hangs on startup/shutdown. I've attached the 2.4 and 2.5 versions.
> Thanks to Subodh Srivastava and Ted Phelps for their bug reports. Here is the
> 2.5 patch included inline for reference:
Applied to my 2.4 and 2.5 trees, thanks.
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-04-15 5:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-12 11:49 [PATCH] USB speedtouch: discard packets for non-existant vcc's Duncan Sands
2003-04-15 5:35 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®