kmodloader: increase module name length
authorSergiy Kibrik <sakib@darkstar.site>
Fri, 22 Feb 2019 06:57:52 +0000 (06:57 +0000)
committerHauke Mehrtens <hauke@hauke-m.de>
Thu, 21 Mar 2019 14:41:53 +0000 (15:41 +0100)
Otherwise modules with long names, e.g. lttng (>32 chars) can't be loaded.

Signed-off-by: Sergiy Kibrik <sakib@darkstar.site>
kmodloader.c

index 3196deb94e17c6fab7e8810b51f9b0be8469f5c8..2e920ef40ca6c6e966ece78784ecd35c4420e68d 100644 (file)
@@ -37,6 +37,8 @@
 #include <libubox/ulog.h>
 
 #define DEF_MOD_PATH "/modules/%s/"
+/* duplicated from in-kernel include/linux/module.h */
+#define MODULE_NAME_LEN (64 - sizeof(unsigned long))
 
 enum {
        SCANNED,
@@ -157,7 +159,7 @@ static char* get_module_path(char *name)
 
 static char* get_module_name(char *path)
 {
-       static char name[33];
+       static char name[MODULE_NAME_LEN];
        char *t;
 
        strncpy(name, basename(path), sizeof(name) - 1);