[Bug 15727] New: insmod return code is broken with MODPROBE_SMALL=y

bugzilla at busybox.net bugzilla at busybox.net
Wed Aug 16 16:59:09 UTC 2023


https://bugs.busybox.net/show_bug.cgi?id=15727

            Bug ID: 15727
           Summary: insmod return code is broken with MODPROBE_SMALL=y
           Product: Busybox
           Version: unspecified
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Other
          Assignee: unassigned at busybox.net
          Reporter: douglas.raillard at arm.com
                CC: busybox-cvs at busybox.net
  Target Milestone: ---

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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the busybox-cvs mailing list