]> git.ipfire.org Git - thirdparty/kmod.git/commit
testsuite: depmod: add module dependency outside cyclic chain
authorMian Yousaf Kaukab <yousaf.kaukab@suse.com>
Tue, 8 Nov 2016 16:45:49 +0000 (17:45 +0100)
committerLucas De Marchi <lucas.demarchi@intel.com>
Wed, 9 Nov 2016 00:28:40 +0000 (22:28 -0200)
commit965886b55ab2f80fc242c1bc7e92423c87424718
tree76d18a0923560d188ab40e6e99f53b6f4809cda2
parentd24270321142baead92285e2637f09da71992868
testsuite: depmod: add module dependency outside cyclic chain

Check that depmod do not report modules outside cyclic chain

Two modules f and g are added which do not have any dependency.
modules a and b are made dependent on f and g.

Here is the output of loop dependency check test after adding this
patch:

TESTSUITE: ERR: wrong:
depmod: ERROR: Found 7 modules in dependency cycles!
depmod: ERROR: Cycle detected: mod_loop_d -> mod_loop_e -> mod_loop_d
depmod: ERROR: Cycle detected: mod_loop_b -> mod_loop_c -> mod_loop_a -> mod_loop_b
depmod: ERROR: Cycle detected: mod_loop_b -> mod_loop_c -> mod_loop_a -> mod_loop_g
depmod: ERROR: Cycle detected: mod_loop_b -> mod_loop_c -> mod_loop_a -> mod_loop_f

Buffer overflow occurs in the loop when last two lines are printed.
43 bytes buffer is allocated and 53 bytes are used.

Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
testsuite/module-playground/Makefile
testsuite/module-playground/mod-loop-a.c
testsuite/module-playground/mod-loop-b.c
testsuite/module-playground/mod-loop-f.c [new file with mode: 0644]
testsuite/module-playground/mod-loop-g.c [new file with mode: 0644]
testsuite/module-playground/mod-loop.h
testsuite/populate-modules.sh