hush/modutils
David Marchand 7d16964c3e modinfo: fix module parsing with kernel >= 2.6.37
display() function returns the length of the value we are displaying + 1.
As a consequence, if we have field=value\0field=value\0field=value in the
binary, then the second occurence will be skipped as ptr will miss the first
character of the following field.

Example trying to list aliases from ixgbe.ko on a 3.2 kernel.

- In the module we have:
alias=pci:v00008086d00001560sv*sd*bc*sc*i*\0
alias=pci:v00008086d0000154Asv*sd*bc*sc*i*\0
alias=pci:v00008086d00001557sv*sd*bc*sc*i*\0
alias=pci:v00008086d0000154Fsv*sd*bc*sc*i*\0
alias=pci:v00008086d0000154Dsv*sd*bc*sc*i*\0
...

- Using modinfo -F alias ixgbe returns:
alias:          pci:v00008086d00001560sv*sd*bc*sc*i*
alias:          pci:v00008086d00001557sv*sd*bc*sc*i*
alias:          pci:v00008086d0000154Dsv*sd*bc*sc*i*
...

This problem appeared with kernel commit "modules: no need to align .modinfo
strings" b6472776816af1ed52848c93d26e3edb3b17adab in 2.6.37.

Fix this by not trusting display() return value but increment ptr by strlen(ptr)
(the same way as depmod.c does).

Signed-off-by: David Marchand <david.marchand@6wind.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-07-04 16:39:28 +02:00
..
Config.src Replace "depends on PLATFORM_LINUX" with "select PLATFORM_LINUX" 2011-02-26 22:24:08 +01:00
depmod_process.sh depmod: fix handling of .gz modules 2009-05-18 13:08:04 +02:00
depmod.c whitespace fixes. no code changes 2013-01-14 01:34:48 +01:00
insmod.c modprobe-small: fix help messages for aliased module-related applets 2014-04-19 15:04:39 +02:00
Kbuild.src *: make GNU licensing statement forms more regular 2010-08-16 20:14:46 +02:00
lsmod.c mass removal of underscores from _BB_DIR_foo and _BB_SUID_foo 2011-01-18 13:58:01 +01:00
modinfo.c modinfo: fix module parsing with kernel >= 2.6.37 2014-07-04 16:39:28 +02:00
modprobe-small.c modprobe-small: fix safe_strncpy truncating last char of module name 2014-05-26 15:01:13 +02:00
modprobe.c modprobe-small: fix help messages for aliased module-related applets 2014-04-19 15:04:39 +02:00
modutils-24.c stop declariong our own dirname prototype 2011-09-10 13:48:34 +02:00
modutils.c modprobe/insmod: fix parameter quoting 2011-02-02 00:01:07 +01:00
modutils.h modprobe/insmod: fix parameter quoting 2011-02-02 00:01:07 +01:00
rmmod.c whitespace cleanup. no code changes 2013-01-14 15:57:44 +01:00