]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
modinfo: skip parm entries without a name
authorEmil Velikov <emil.l.velikov@gmail.com>
Sun, 2 Aug 2026 12:26:13 +0000 (13:26 +0100)
committerLucas De Marchi <demarchi@kernel.org>
Mon, 10 Aug 2026 13:49:47 +0000 (08:49 -0500)
Specially crafted/corrupt modules may have a parm/parmtype entry which
lacks the "name:" prefix. Throw a warning and skip such entries.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/451
Signed-off-by: Lucas De Marchi <demarchi@kernel.org>
tools/modinfo.c

index 55e97da3c7b6e209d9480baf8e1d8b380f88a729..21688ed538a8c108d88dfc6106f3f2c16d6c4a76 100644 (file)
@@ -88,6 +88,11 @@ static int process_parm(const char *key, const char *value, struct param **param
                return 0;
        }
 
+       if (colon == value) {
+               ERR("Missing param name in value \"%s\"\n", value);
+               return 0;
+       }
+
        name = value;
        namelen = colon - value;
        if (streq(key, "parm")) {