summaryrefslogtreecommitdiff
path: root/kmodloader.c
diff options
context:
space:
mode:
authorSergiy Kibrik <sakib@darkstar.site>2019-02-22 06:57:52 +0000
committerHauke Mehrtens <hauke@hauke-m.de>2019-03-21 15:41:53 +0100
commita782779552a0d68e3bb588e3039eb95da15ec7b0 (patch)
treec3e603bbb4f5c29a6605637d2099065188d39fb7 /kmodloader.c
parent876c7f5bfb9b13d48e6d7960dd114082a0a95a6d (diff)
downloadubox-a782779552a0d68e3bb588e3039eb95da15ec7b0.tar.gz
kmodloader: increase module name length
Otherwise modules with long names, e.g. lttng (>32 chars) can't be loaded. Signed-off-by: Sergiy Kibrik <sakib@darkstar.site>
Diffstat (limited to 'kmodloader.c')
-rw-r--r--kmodloader.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kmodloader.c b/kmodloader.c
index 3196deb..2e920ef 100644
--- a/kmodloader.c
+++ b/kmodloader.c
@@ -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);