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

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Kees Cook <kees@...>
Cc: Greg KH <greg@...>, Alexey Dobriyan <adobriyan@...>, <linux-kernel@...>, Andrew Morton <akpm@...>, Jeff Garzik <jeff@...>, Michael Wu <flamingice@...>, Ben Collins <bcollins@...>
Date: Sunday, September 16, 2007 - 9:22 pm

Hi Kees,


On 9/13/07, Kees Cook <kees@ubuntu.com> wrote:

Nice! :-)

BTW a very similar idea (but for a different problem) was discussed in:
http://lkml.org/lkml/2007/8/23/48

I tried doing something about that, but gave up in between. For the
device_id tables, a lot of infrastructure/code already exists in modpost,
but no such luck for kobjects :-( Still, if you can do something about
that, as he mentioned, I bet Greg would gladly accept such a patch :-)



If you pass the Elf_Sym *sym all the way from handle_moddevtable() (which
means you can get rid of the sym->st_size argument in the call chain), then
it would be possible to print out the *symbol name* too here ...



uint8_t *p;




... and:

        for (p = symval+size-id_size; p < symval+size; p++) {
                if (*p) {

is probably clearer ?



As I just said, printing out just the modname and device_id "type" sounds
insufficient here. Note that they were sufficient before your patch, because
previously, this function only checked if the device_id *type* itself was
incorrectly defined. But here we're talking about a specific errant *symbol*.



Again, "for (p = symval+size-id_size; p < symval+size; p++) {"
and then "fprintf(..., *p);" would be cleaner.



Subtle nit, but it's not really a "NULL" entry. It's an "empty object" entry,
not a "NULL" pointer ... how about replacing "a NULL" with "an empty" ?



Hmm, I don't quite grok this case. Care to explain?




Satyam
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] pci: fix unterminated pci_device_id lists, Kees Cook, (Wed Sep 12, 2:41 am)
Re: [PATCH] pci: fix unterminated pci_device_id lists, Jeff Garzik, (Wed Sep 12, 7:10 am)
Re: [PATCH] pci: fix unterminated pci_device_id lists, Alexey Dobriyan, (Wed Sep 12, 7:48 am)
Re: [PATCH] modpost: detect unterminated device id lists, Satyam Sharma, (Sun Sep 16, 9:22 pm)
Re: [PATCH] modpost: detect unterminated device id lists, Andrew Morton, (Mon Sep 17, 2:48 am)
Re: [PATCH] modpost: detect unterminated device id lists, Andrew Morton, (Sun Sep 16, 6:14 pm)
Re: [PATCH] modpost: detect unterminated device id lists, Satyam Sharma, (Sun Sep 16, 8:24 pm)
Re: [PATCH] modpost: detect unterminated device id lists, Andrew Morton, (Mon Sep 17, 2:46 am)
Re: [PATCH] modpost: detect unterminated device id lists, Satyam Sharma, (Mon Sep 17, 5:45 pm)
Re: [PATCH] modpost: detect unterminated device id lists, Andrew Morton, (Mon Sep 17, 5:50 pm)
Re: [PATCH] modpost: detect unterminated device id lists, Mauro Carvalho Chehab, (Mon Sep 17, 7:36 pm)
Re: [PATCH] modpost: detect unterminated device id lists, Andrew Morton, (Wed Sep 12, 9:21 pm)
Re: [PATCH] pci: fix unterminated pci_device_id lists, Andrew Morton, (Wed Sep 12, 7:08 pm)
Re: [PATCH] pci: fix unterminated pci_device_id lists, Alexey Dobriyan, (Thu Sep 13, 2:34 am)
Re: [PATCH] pci: fix unterminated pci_device_id lists, Sam Ravnborg, (Thu Sep 13, 2:58 am)
Re: [PATCH] pci: fix unterminated pci_device_id lists, Jeff Garzik, (Thu Sep 13, 2:42 am)
Re: [PATCH] pci: fix unterminated pci_device_id lists, Jan Engelhardt, (Sat Sep 15, 5:01 am)