| Summary: | insmod return code is broken with MODPROBE_SMALL=y | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | douglas.raillard |
| Component: | Other | Assignee: | unassigned |
| Status: | NEW --- | ||
| Severity: | normal | CC: | busybox-cvs |
| Priority: | P5 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
insmod (from version 1.31.1 at least to 1.36.1 at least) does not forward the return code of the kernel module init function properly when compiled with MODPROBE_SMALL=y. This is problematic for callers expecting to distinguish different issues based on that. The code with MODPROBE_SMALL=y is: modutils/modprobe-small.c if (init_module(map, len, (IF_FEATURE_CMDLINE_MODULE_OPTIONS(options ? options : ) "") ) != 0 ) { bb_error_msg_and_die("can't insert '%s': %s", *argv, moderror(errno)); } So it's quite clear that all non-zero return values for init_module() are treated exactly the same. In contrast, modutils/insmod.c forwards the return value correctly: rc = bb_init_module(filename, parse_cmdline_module_options(argv, /*quote_spaces:*/ 0)); if (rc) bb_error_msg("can't insert '%s': %s", filename, moderror(rc)); return rc; To fix that, modprobe-small.c should return "errno" instead of dying with a generic error code.