]> git.ipfire.org Git - thirdparty/kmod.git/commit
depmod: ignore related modules in depmod_report_cycles
authorMian Yousaf Kaukab <yousaf.kaukab@suse.com>
Tue, 8 Nov 2016 16:45:50 +0000 (17:45 +0100)
committerLucas De Marchi <lucas.demarchi@intel.com>
Wed, 9 Nov 2016 00:38:34 +0000 (22:38 -0200)
commit6b77f188969d72254f6bda291f4f2d9fd42f5ecc
treee0791bc21c4b8d930af1da3e27d0f544ce3ca685
parent965886b55ab2f80fc242c1bc7e92423c87424718
depmod: ignore related modules in depmod_report_cycles

Only print actual cyclic dependencies. Print count of all the modules
in cyclic dependency at the end of the function so that dependent
modules which are not in cyclic chain can be ignored.

Printing dependent modules which are not in cyclic chain causes buffer
overflow as m->modnamesz is not included in buffer size calculations
(loop == m is never true). This buffer overflow causes kmod to crash.

Update depmod test to reflect the change as well.

Reported-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
testsuite/rootfs-pristine/test-depmod/detect-loop/correct.txt
tools/depmod.c