Re: [PATCH] modpost: detect unterminated device id lists



On Wed, 12 Sep 2007 17:49:37 -0700 Kees Cook <kees@xxxxxxxxxx> wrote:

On Wed, Sep 12, 2007 at 02:53:56PM -0700, Greg KH wrote:
On Wed, Sep 12, 2007 at 03:48:49PM +0400, Alexey Dobriyan wrote:
On 9/12/07, Jeff Garzik <jeff@xxxxxxxxxx> wrote:
Kees Cook wrote:
This patch against 2.6.23-rc6 fixes a couple drivers that do not
correctly terminate their pci_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,
cause those unfortunate device IDs to not auto-load.

Signed-off-by: Kees Cook <kees@xxxxxxxxxx>

ACK

I mut say, non-terminated PCI ids lists are constant PITA. There should be
a way to a) put it in macro[1], so that terminator automatically added, and
b) still allow #ifdef inside table like, e.g. 8139too does.

[1] or not macro, because #ifdef inside macros aren't allowed.

If you know of a way to do this in an easier manner, patches are always
gladly accepted :)

This patch against 2.6.23-rc6 will cause modpost to fail if any device
id lists are incorrectly terminated, after reporting the offender.

ooh, clever chap.

+ fprintf(stderr,"%s: struct %s_device_id is %lu bytes. The last of %lu is:\n", modname, device_id, id_size, size / id_size);

dude, bid on this: http://cgi.ebay.com/Wyse-WY55-General-Purpose-Serial-Terminal-No-Keyboard_W0QQitemZ230169388145QQihZ013QQcategoryZ51280QQssPageNameZWDVWQQrdZ1QQcmdZViewItem

(not allowed to use 132-column mode, either)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: expandable test if token-lists consist of the same set of tokens?
    ... \detokenize-ation of the two lists are the same, ... Check if it is possible to strip off surrounding braces (a ... I think you can test this by comparing \detokenize ... Otherwise terminate with \@secondoftwo. ...
    (comp.text.tex)
  • [PATCH] modpost: detect unterminated device id lists
    ... correctly terminate their pci_device_id lists. ... 28 NULL bytes following the table, and/or the last PCI ID is actually ... non-terminated PCI ids lists are constant PITA. ... Elf_Sym *sym, const char *symname) ...
    (Linux-Kernel)
  • Re: expandable test if token-lists consist of the same set of tokens?
    ... In case was enclosed into braces, ... terminate with false. ... And with both lists you can remove braces from the "first argument". ... I want an undefined-error if it comes to the "attempt" of ...
    (comp.text.tex)
  • Bugcheck 3C4 Alpha 7.2-2 $audit_event User Mode
    ... If you forget to terminate the itemlist to $audit_event you can crash ... My Tier3 code has nsa$_chain codes to addition lists depending on whether ... image is installed with oodles of privileges and I've wasted enough time ...
    (comp.os.vms)
  • Re: [PATCH] EDAC: core EDAC support code
    ... I'm looking at the EDAC sysfs interface. ... the following files contain whitespace-delimited lists: ... PCI vendor-ID:device-ID series list. ... indicate that the memory type it represents is supported. ...
    (Linux-Kernel)