Skip to content

Commit f2850dd

Browse files
committed
Merge tag 'kbuild-fixes-v5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kbuild fixes from Masahiro Yamada: - fix memory corruption in scripts/kallsyms - fix the vmlinux link stage to correctly update compile.h * tag 'kbuild-fixes-v5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kbuild: fix mismatch between .version and include/generated/compile.h scripts/kallsyms: fix memory corruption caused by write over-run
2 parents 359c92c + 083bc0e commit f2850dd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

scripts/kallsyms.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ static struct sym_entry *read_symbol(FILE *in)
210210

211211
len = strlen(name) + 1;
212212

213-
sym = malloc(sizeof(*sym) + len);
213+
sym = malloc(sizeof(*sym) + len + 1);
214214
if (!sym) {
215215
fprintf(stderr, "kallsyms failure: "
216216
"unable to allocate required amount of memory\n");
@@ -219,7 +219,7 @@ static struct sym_entry *read_symbol(FILE *in)
219219
sym->addr = addr;
220220
sym->len = len;
221221
sym->sym[0] = type;
222-
memcpy(sym_name(sym), name, len);
222+
strcpy(sym_name(sym), name);
223223
sym->percpu_absolute = 0;
224224

225225
return sym;

scripts/link-vmlinux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ else
239239
fi;
240240

241241
# final build of init/
242-
${MAKE} -f "${srctree}/scripts/Makefile.build" obj=init
242+
${MAKE} -f "${srctree}/scripts/Makefile.build" obj=init need-builtin=1
243243

244244
#link vmlinux.o
245245
info LD vmlinux.o

0 commit comments

Comments
 (0)