diff mbox series

[OpenWrt-Devel,v2,ubox] kmodloader: increase module name length

Message ID mailman.23141.1550818672.2376.openwrt-devel@lists.openwrt.org
State Accepted
Delegated to: Hauke Mehrtens
Headers show
Series [OpenWrt-Devel,v2,ubox] kmodloader: increase module name length | expand

Commit Message

hurrhnn--- via openwrt-devel Feb. 22, 2019, 6:57 a.m. UTC
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.
From: Sergiy Kibrik <sakib@darkstar.site>

Otherwise modules with long names, e.g. lttng (>32 chars) can't be loaded.

Signed-off-by: Sergiy Kibrik <sakib@darkstar.site>
---
 kmodloader.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

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);