mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-22 23:13:01 +02:00
kprobes: Fix to check symbol prefixes correctly
[ Upstream commit8c8acb8f26
] Since str_has_prefix() takes the prefix as the 2nd argument and the string as the first, is_cfi_preamble_symbol() always fails to check the prefix. Fix the function parameter order so that it correctly check the prefix. Link: https://lore.kernel.org/all/172260679559.362040.7360872132937227206.stgit@devnote2/ Fixes:de02f2ac5d
("kprobes: Prohibit probing on CFI preamble symbol") Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
36635742cf
commit
3cb624b698
|
@ -1552,8 +1552,8 @@ static bool is_cfi_preamble_symbol(unsigned long addr)
|
||||||
if (lookup_symbol_name(addr, symbuf))
|
if (lookup_symbol_name(addr, symbuf))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return str_has_prefix("__cfi_", symbuf) ||
|
return str_has_prefix(symbuf, "__cfi_") ||
|
||||||
str_has_prefix("__pfx_", symbuf);
|
str_has_prefix(symbuf, "__pfx_");
|
||||||
}
|
}
|
||||||
|
|
||||||
static int check_kprobe_address_safe(struct kprobe *p,
|
static int check_kprobe_address_safe(struct kprobe *p,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user