[From nobody Thu Jun 25 05:55:03 2020
Received: from pb-smtp1.pobox.com ([64.147.108.70])
 by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
 id 1gx4mL-00046l-Oq
 for openwrt-devel@lists.openwrt.org; Fri, 22 Feb 2019 06:57:51 +0000
Received: from pb-smtp1.pobox.com (unknown [127.0.0.1])
 by pb-smtp1.pobox.com (Postfix) with ESMTP id E2D961400B4;
 Fri, 22 Feb 2019 01:57:42 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc
 :subject:date:message-id; s=sasl; bh=8vhfqzxGW3JY29/HUU2qLQnbEmc
 =; b=vOCLHICYNWBN55kwvDH3KfJUgXDH5hVj8yglYsCRoC9NEk7IXiEm61TFMnA
 FA9/rDCrogPdXgr1yUjl6ghcTP6bZ+FumbJaO+Q9mnBh821QTNHAsegRVWlS9ZSi
 h1tFF5HfTqt8O91hajOXE2WSRIlH4R6tLgoNm4kz06Ytp4iY=
Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1])
 by pb-smtp1.pobox.com (Postfix) with ESMTP id DA3F41400B3;
 Fri, 22 Feb 2019 01:57:42 -0500 (EST)
Received: from localhost (unknown [95.67.106.230])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (No client certificate requested)
 by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 143D31400B2;
 Fri, 22 Feb 2019 01:57:42 -0500 (EST)
From: Sergiy Kibrik &lt;sakib@ubnt.com&gt;
To: openwrt-devel@lists.openwrt.org
Cc: =?UTF-8?q?Bj=C3=B8rn=20Mork?= &lt;bjorn@mork.no&gt;,
 Sergiy Kibrik &lt;sakib@darkstar.site&gt;
Subject: [PATCH v2] [ubox] kmodloader: increase module name length
Date: Fri, 22 Feb 2019 08:57:38 +0200
Message-Id: &lt;1550818658-9866-1-git-send-email-sakib@ubnt.com&gt;
X-Mailer: git-send-email 2.7.4
X-Pobox-Relay-ID: 2628815E-366F-11E9-BD8A-F733E42159A7-90055647!pb-smtp1.pobox.com
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
X-CRM114-CacheID: sfid-20190221_225749_894475_27DC3592 
X-CRM114-Status: UNSURE (   7.76  )
X-CRM114-Notice: Please train this message.
X-Spam-Score: -0.7 (/)
X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary:
 Content analysis details:   (-0.7 points)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at http://www.dnswl.org/,
 low trust [64.147.108.70 listed in list.dnswl.org]
 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
 mail domains are different
 0.1 DKIM_SIGNED            Message has a DKIM or DK signature, not necessarily
 valid
 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature

From: Sergiy Kibrik &lt;sakib@darkstar.site&gt;

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

Signed-off-by: Sergiy Kibrik &lt;sakib@darkstar.site&gt;
---
 kmodloader.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kmodloader.c b/kmodloader.c
index 3196deb..2e920ef 100644
--- a/kmodloader.c
+++ b/kmodloader.c
@@ -37,6 +37,8 @@
 #include &lt;libubox/ulog.h&gt;
 
 #define DEF_MOD_PATH &quot;/modules/%s/&quot;
+/* 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);
-- 
2.7.4


]