mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 01:32:21 +02:00
In kallsyms__parse(), the loop reading symbol names iterates with i <
sizeof(symbol_name), which allows i to reach sizeof(symbol_name) upon
loop exit. The subsequent symbol_name[i] = '\0' then writes one byte
past the end of the stack-allocated symbol_name[] array.
Fix this by changing the loop bound to KSYM_NAME_LEN, so the null
terminator always lands within the array. The overflow is triggerable by
a kallsyms entry with a symbol name of KSYM_NAME_LEN+1 or more
characters (e.g., long Rust mangled names or a malicious
/proc/kallsyms).
Fixes:
|
||
|---|---|---|
| .. | ||
| Build | ||
| kallsyms.c | ||
| kallsyms.h | ||
| Makefile | ||