Skip to content

Commit c9a72e7

Browse files
authored
Merge pull request #133 from ojeda/depmod
Fix depmod issue found in rust-next
2 parents 13517bc + a30f404 commit c9a72e7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

include/linux/moduleparam.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#endif
1919

2020
/* Chosen so that structs with an unsigned long line up. */
21-
#define MAX_PARAM_PREFIX_LEN (256 - sizeof(unsigned long))
21+
#define MAX_PARAM_PREFIX_LEN (64 - sizeof(unsigned long))
2222

2323
#define __MODULE_INFO(tag, name, info) \
2424
static const char __UNIQUE_ID(name)[] \

kernel/livepatch/core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,10 @@ static int klp_resolve_symbols(Elf64_Shdr *sechdrs, const char *strtab,
210210
* and KSYM_NAME_LEN have the values we expect them to have.
211211
*
212212
* Because the value of MODULE_NAME_LEN can differ among architectures,
213-
* we use the smallest/strictest upper bound possible (248, based on
213+
* we use the smallest/strictest upper bound possible (56, based on
214214
* the current definition of MODULE_NAME_LEN) to prevent overflows.
215215
*/
216-
BUILD_BUG_ON(MODULE_NAME_LEN < 248 || KSYM_NAME_LEN != 512);
216+
BUILD_BUG_ON(MODULE_NAME_LEN < 56 || KSYM_NAME_LEN != 512);
217217

218218
relas = (Elf_Rela *) relasec->sh_addr;
219219
/* For each rela in this klp relocation section */
@@ -227,7 +227,7 @@ static int klp_resolve_symbols(Elf64_Shdr *sechdrs, const char *strtab,
227227

228228
/* Format: .klp.sym.sym_objname.sym_name,sympos */
229229
cnt = sscanf(strtab + sym->st_name,
230-
".klp.sym.%247[^.].%511[^,],%lu",
230+
".klp.sym.%55[^.].%511[^,],%lu",
231231
sym_objname, sym_name, &sympos);
232232
if (cnt != 3) {
233233
pr_err("symbol %s has an incorrectly formatted name\n",

0 commit comments

Comments
 (0)