diff options
author | David Marchand <david.marchand@6wind.com> | 2014-07-03 12:24:55 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2014-07-04 16:39:28 +0200 |
commit | 7d16964c3ebb9e7beee89ad96f824470f7ab5346 (patch) | |
tree | 28d1e30f6f6b5f932d90223d6a4e7c53a994a26f /libbb/selinux_common.c | |
parent | 03e17bfa8d71c0feca01c94a820ce2f3736a35b8 (diff) | |
download | busybox-7d16964c3ebb9e7beee89ad96f824470f7ab5346.tar.gz |
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>
Diffstat (limited to 'libbb/selinux_common.c')
0 files changed, 0 insertions, 0 deletions