* [PATCH] usb: fix unterminated usn_device_id lists
@ 2007-09-13 0:47 Kees Cook
2007-09-13 1:15 ` Jeff Garzik
0 siblings, 1 reply; 6+ messages in thread
From: Kees Cook @ 2007-09-13 0:47 UTC (permalink / raw)
To: linux-kernel, Ben Collins
This patch against 2.6.23-rc6 fixes a unterminated list of USB device ids.
Signed-off-by: Kees Cook <kees@ubuntu.com>
---
linux-2.6.23-rc6/drivers/media/video/usbvision/usbvision-cards.c | 1 +
1 file changed, 1 insertion(+)
---
diff -urp -x '*.o' linux-2.6.23-rc6~/drivers/media/video/usbvision/usbvision-cards.c linux-2.6.23-rc6/drivers/media/video/usbvision/usbvision-cards.c
--- linux-2.6.23-rc6~/drivers/media/video/usbvision/usbvision-cards.c 2007-09-11 23:17:19.000000000 -0700
+++ linux-2.6.23-rc6/drivers/media/video/usbvision/usbvision-cards.c 2007-09-12 17:26:46.000000000 -0700
@@ -1081,6 +1081,7 @@ struct usb_device_id usbvision_table []
{ USB_DEVICE(0x2304, 0x0301), .driver_info=PINNA_LINX_VD_IN_CAB_PAL },
{ USB_DEVICE(0x2304, 0x0419), .driver_info=PINNA_PCTV_BUNGEE_PAL_FM },
{ USB_DEVICE(0x2400, 0x4200), .driver_info=HPG_WINTV },
+ { 0, },
};
MODULE_DEVICE_TABLE (usb, usbvision_table);
--
Kees Cook
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] usb: fix unterminated usn_device_id lists 2007-09-13 0:47 [PATCH] usb: fix unterminated usn_device_id lists Kees Cook @ 2007-09-13 1:15 ` Jeff Garzik 2007-09-13 3:54 ` Kees Cook 0 siblings, 1 reply; 6+ messages in thread From: Jeff Garzik @ 2007-09-13 1:15 UTC (permalink / raw) To: Kees Cook; +Cc: linux-kernel, Ben Collins Kees Cook wrote: > This patch against 2.6.23-rc6 fixes a unterminated list of USB device ids. > > Signed-off-by: Kees Cook <kees@ubuntu.com> > --- > linux-2.6.23-rc6/drivers/media/video/usbvision/usbvision-cards.c | 1 + > 1 file changed, 1 insertion(+) > --- > diff -urp -x '*.o' linux-2.6.23-rc6~/drivers/media/video/usbvision/usbvision-cards.c linux-2.6.23-rc6/drivers/media/video/usbvision/usbvision-cards.c > --- linux-2.6.23-rc6~/drivers/media/video/usbvision/usbvision-cards.c 2007-09-11 23:17:19.000000000 -0700 > +++ linux-2.6.23-rc6/drivers/media/video/usbvision/usbvision-cards.c 2007-09-12 17:26:46.000000000 -0700 > @@ -1081,6 +1081,7 @@ struct usb_device_id usbvision_table [] > { USB_DEVICE(0x2304, 0x0301), .driver_info=PINNA_LINX_VD_IN_CAB_PAL }, > { USB_DEVICE(0x2304, 0x0419), .driver_info=PINNA_PCTV_BUNGEE_PAL_FM }, > { USB_DEVICE(0x2400, 0x4200), .driver_info=HPG_WINTV }, > + { 0, }, FWIW I (and several drivers) tend to prefer the more clean version, { }, or even { }, /* terminate list */ Regards, Jeff ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] usb: fix unterminated usn_device_id lists 2007-09-13 1:15 ` Jeff Garzik @ 2007-09-13 3:54 ` Kees Cook 2007-09-13 4:02 ` Jeff Garzik 0 siblings, 1 reply; 6+ messages in thread From: Kees Cook @ 2007-09-13 3:54 UTC (permalink / raw) To: Jeff Garzik; +Cc: linux-kernel, Ben Collins Hi, On Wed, Sep 12, 2007 at 09:15:07PM -0400, Jeff Garzik wrote: >> + { 0, }, > > FWIW I (and several drivers) tend to prefer the more clean version, > > { }, > > or even > > { }, /* terminate list */ Ah, yes. I see that now in some of the other drivers. Should I re-send this patch (and/or the other PCI patches)? Thanks, -Kees -- Kees Cook ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] usb: fix unterminated usn_device_id lists 2007-09-13 3:54 ` Kees Cook @ 2007-09-13 4:02 ` Jeff Garzik 2007-09-13 4:45 ` [PATCHv2] misc: fix unterminated *_device_id lists Kees Cook 0 siblings, 1 reply; 6+ messages in thread From: Jeff Garzik @ 2007-09-13 4:02 UTC (permalink / raw) To: Kees Cook; +Cc: linux-kernel, Ben Collins Kees Cook wrote: > Hi, > > On Wed, Sep 12, 2007 at 09:15:07PM -0400, Jeff Garzik wrote: >>> + { 0, }, >> FWIW I (and several drivers) tend to prefer the more clean version, >> >> { }, >> >> or even >> >> { }, /* terminate list */ > > Ah, yes. I see that now in some of the other drivers. Should I re-send > this patch (and/or the other PCI patches)? Can't hurt... but I cannot speak for other maintainers. Jeff ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCHv2] misc: fix unterminated *_device_id lists 2007-09-13 4:02 ` Jeff Garzik @ 2007-09-13 4:45 ` Kees Cook 2007-09-13 5:09 ` Jeff Garzik 0 siblings, 1 reply; 6+ messages in thread From: Kees Cook @ 2007-09-13 4:45 UTC (permalink / raw) To: Jeff Garzik; +Cc: linux-kernel, Ben Collins Fixes drivers that do not correctly terminate their *_device_id lists. This results in garbage being spewed into modules.pcimap when the module happens to not have 28 NULL bytes following the table, and/or the last PCI ID is actually truncated from the table when calculating the modules.alias PCI aliases, causing those unfortunate device IDs to not auto-load. Signed-off-by: Kees Cook <kees@ubuntu.com> --- Re-send, using recommended list termination code-style. Diff is against 2.6.23-rc6. linux-2.6.23-rc6/drivers/char/ipmi/ipmi_si_intf.c | 3 ++- linux-2.6.23-rc6/drivers/media/video/usbvision/usbvision-cards.c | 1 + linux-2.6.23-rc6/drivers/mtd/nand/cafe_nand.c | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) --- diff -uNrp linux-2.6.23-rc6~/drivers/char/ipmi/ipmi_si_intf.c linux-2.6.23-rc6/drivers/char/ipmi/ipmi_si_intf.c --- linux-2.6.23-rc6~/drivers/char/ipmi/ipmi_si_intf.c 2007-09-11 23:17:13.000000000 -0700 +++ linux-2.6.23-rc6/drivers/char/ipmi/ipmi_si_intf.c 2007-09-11 23:21:51.000000000 -0700 @@ -2215,7 +2215,8 @@ static int ipmi_pci_resume(struct pci_de static struct pci_device_id ipmi_pci_devices[] = { { PCI_DEVICE(PCI_HP_VENDOR_ID, PCI_MMC_DEVICE_ID) }, - { PCI_DEVICE_CLASS(PCI_ERMC_CLASSCODE, PCI_ERMC_CLASSCODE_MASK) } + { PCI_DEVICE_CLASS(PCI_ERMC_CLASSCODE, PCI_ERMC_CLASSCODE_MASK) }, + { }, /* terminate list */ }; MODULE_DEVICE_TABLE(pci, ipmi_pci_devices); diff -uNrp linux-2.6.23-rc6~/drivers/mtd/nand/cafe_nand.c linux-2.6.23-rc6/drivers/mtd/nand/cafe_nand.c --- linux-2.6.23-rc6~/drivers/mtd/nand/cafe_nand.c 2007-07-08 16:32:17.000000000 -0700 +++ linux-2.6.23-rc6/drivers/mtd/nand/cafe_nand.c 2007-09-11 23:22:11.000000000 -0700 @@ -816,7 +816,8 @@ static void __devexit cafe_nand_remove(s } static struct pci_device_id cafe_nand_tbl[] = { - { 0x11ab, 0x4100, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MEMORY_FLASH << 8, 0xFFFF0 } + { 0x11ab, 0x4100, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MEMORY_FLASH << 8, 0xFFFF0 }, + { }, /* terminate list */ }; MODULE_DEVICE_TABLE(pci, cafe_nand_tbl); diff -urp -x '*.o' linux-2.6.23-rc6~/drivers/media/video/usbvision/usbvision-cards.c linux-2.6.23-rc6/drivers/media/video/usbvision/usbvision-cards.c --- linux-2.6.23-rc6~/drivers/media/video/usbvision/usbvision-cards.c 2007-09-11 23:17:19.000000000 -0700 +++ linux-2.6.23-rc6/drivers/media/video/usbvision/usbvision-cards.c 2007-09-12 17:26:46.000000000 -0700 @@ -1081,6 +1081,7 @@ struct usb_device_id usbvision_table [] { USB_DEVICE(0x2304, 0x0301), .driver_info=PINNA_LINX_VD_IN_CAB_PAL }, { USB_DEVICE(0x2304, 0x0419), .driver_info=PINNA_PCTV_BUNGEE_PAL_FM }, { USB_DEVICE(0x2400, 0x4200), .driver_info=HPG_WINTV }, + { }, /* terminate list */ }; MODULE_DEVICE_TABLE (usb, usbvision_table); -- Kees Cook ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCHv2] misc: fix unterminated *_device_id lists 2007-09-13 4:45 ` [PATCHv2] misc: fix unterminated *_device_id lists Kees Cook @ 2007-09-13 5:09 ` Jeff Garzik 0 siblings, 0 replies; 6+ messages in thread From: Jeff Garzik @ 2007-09-13 5:09 UTC (permalink / raw) To: Kees Cook; +Cc: linux-kernel, Ben Collins Kees Cook wrote: > Fixes drivers that do not correctly terminate their *_device_id lists. > This results in garbage being spewed into modules.pcimap when the module > happens to not have 28 NULL bytes following the table, and/or the last PCI > ID is actually truncated from the table when calculating the modules.alias > PCI aliases, causing those unfortunate device IDs to not auto-load. > > Signed-off-by: Kees Cook <kees@ubuntu.com> > --- > Re-send, using recommended list termination code-style. > Diff is against 2.6.23-rc6. ACK ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-09-13 5:09 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2007-09-13 0:47 [PATCH] usb: fix unterminated usn_device_id lists Kees Cook 2007-09-13 1:15 ` Jeff Garzik 2007-09-13 3:54 ` Kees Cook 2007-09-13 4:02 ` Jeff Garzik 2007-09-13 4:45 ` [PATCHv2] misc: fix unterminated *_device_id lists Kees Cook 2007-09-13 5:09 ` Jeff Garzik
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox