mirror of
https://github.com/AuxXxilium/kmod.git
synced 2024-11-24 07:20:52 +07:00
965886b55a
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>
28 lines
439 B
C
28 lines
439 B
C
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
|
|
|
#include <linux/init.h>
|
|
#include <linux/module.h>
|
|
#include <linux/printk.h>
|
|
|
|
#include "mod-loop.h"
|
|
|
|
static int __init test_module_init(void)
|
|
{
|
|
printA();
|
|
printB();
|
|
printF();
|
|
printG();
|
|
|
|
return 0;
|
|
}
|
|
module_init(test_module_init);
|
|
|
|
void printA(void)
|
|
{
|
|
pr_warn("Hello, world A\n");
|
|
}
|
|
EXPORT_SYMBOL(printA);
|
|
|
|
MODULE_AUTHOR("Lucas De Marchi <lucas.demarchi@intel.com>");
|
|
MODULE_LICENSE("LGPL");
|