mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 18:39:59 +00:00
objtool: Fix double-free in .cold detection error path
[ Upstream commit0b9301fb63
] If read_symbols() fails during second list traversal (the one dealing with ".cold" subfunctions) it frees the symbol, but never deletes it from the list/hash_table resulting in symbol being freed again in elf_close(). Fix it by just returning an error, leaving cleanup to elf_close(). Signed-off-by: Artem Savkov <asavkov@redhat.com> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Fixes:13810435b9
("objtool: Support GCC 8's cold subfunctions") Link: http://lkml.kernel.org/r/beac5a9b7da9e8be90223459dcbe07766ae437dd.1542736240.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
7d14117bd2
commit
de21975e71
1 changed files with 1 additions and 1 deletions
|
@ -312,7 +312,7 @@ static int read_symbols(struct elf *elf)
|
|||
if (!pfunc) {
|
||||
WARN("%s(): can't find parent function",
|
||||
sym->name);
|
||||
goto err;
|
||||
return -1;
|
||||
}
|
||||
|
||||
sym->pfunc = pfunc;
|
||||
|
|
Loading…
Reference in a new issue