This option can be extremely dangerous: it tells the kernel to ignore
the module version and vermagic fields when loading. With this option,
you can load modules build locally or by third parties, although this
- can lead to memory corruption, system crashes and data loss.
+ can lead to memory corruption, system crashes and data loss. This is
+ the same as using both *--force-vermagic* and *--force-modversion*.
+
+*--force-modversion*
+ When modules are compiled with CONFIG_MODVERSIONS set, a section
+ detailing the versions of every interfaced used by (or supplied by) the
+ module is created. If a module fails to load and the kernel complains
+ that the module disagrees about a version of some interface, you can use
+ *--force-modversion* to remove the version information altogether.
+
+*--force-vermagic*
+ Every module contains a small string containing important information,
+ such as the kernel and compiler versions. If a module fails to load and
+ the kernel complains that the "version magic" doesn't match, you can use
+ this option to remove it. Naturally, this check is there for your
+ protection, so using this option is dangerous unless you know what
+ you're doing.
*-s*, *--syslog*
Send errors to syslog instead of standard error.
complete -c insmod -f
complete -c insmod -s f -l force -d "DANGEROUS: forces a module load, may cause data corruption and crash your machine"
+complete -c insmod -l force-modversion -d "DANGEROUS: Ignore module's version, may cause data corruption and crash your machine"
+complete -c insmod -l force-vermagic -d "DANGEROUS: Ignore module's version magic, may cause data corruption and crash your machine"
complete -c insmod -s s -l syslog -d 'print to syslog, not stderr'
complete -c insmod -s v -l verbose -d 'enables more messages'
complete -c insmod -s V -l version -d 'show version'
_arguments \
{-f,--force}'[DANGEROUS: forces a module load, may cause data corruption and crash your machine]' \
+ --force-modversion'[ignore module version, may cause data corruption and crash your machine]' \
+ --force-vermagic'[ignore module version magic, may cause data corruption and crash your machine]' \
{-s,--syslog}'[print to syslog, not stderr]' \
{-v,--verbose}'[enables more messages]' \
{-V,--version}'[show version]' \
static const struct option cmdopts[] = {
// clang-format off
{ "force", no_argument, 0, 'f' },
+ { "force-modversion", no_argument, 0, 2 },
+ { "force-vermagic", no_argument, 0, 1 },
{ "syslog", no_argument, 0, 's' },
{ "verbose", no_argument, 0, 'v' },
{ "version", no_argument, 0, 'V' },
printf("Usage:\n"
"\t%s [options] filename [module options]\n"
"Options:\n"
- "\t-f, --force DANGEROUS: forces a module load, may cause\n"
- "\t data corruption and crash your machine\n"
- "\t-s, --syslog print to syslog, not stderr\n"
- "\t-v, --verbose enables more messages\n"
- "\t-V, --version show version\n"
- "\t-h, --help show this help\n",
+ "\t-f, --force DANGEROUS: forces a module load, may cause\n"
+ "\t data corruption and crash your machine.\n"
+ "\t implies --force-modversion and\n"
+ "\t --force-vermagic\n"
+ "\t --force-modversion Ignore module's version\n"
+ "\t --force-vermagic Ignore module's version magic\n"
+ "\t-s, --syslog print to syslog, not stderr\n"
+ "\t-v, --verbose enables more messages\n"
+ "\t-V, --version show version\n"
+ "\t-h, --help show this help\n",
program_invocation_short_name);
}
flags |= KMOD_PROBE_FORCE_MODVERSION;
flags |= KMOD_PROBE_FORCE_VERMAGIC;
break;
+ case 2:
+ flags |= KMOD_PROBE_FORCE_MODVERSION;
+ break;
+ case 1:
+ flags |= KMOD_PROBE_FORCE_VERMAGIC;
+ break;
case 's':
use_syslog = true;
break;