Cc: Greg KH <greg@...>, Alexey Dobriyan <adobriyan@...>, <linux-kernel@...>, Andrew Morton <akpm@...>, Jeff Garzik <jeff@...>, Michael Wu <flamingice@...>, Ben Collins <bcollins@...>
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
-