objtool: Fix double-free in .cold detection error path
Artem Savkov authored

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: default avatarArtem Savkov <asavkov@redhat.com>
Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: 13810435 ("objtool: Support GCC 8's cold subfunctions")
Link: http://lkml.kernel.org/r/beac5a9b7da9e8be90223459dcbe07766ae437dd.1542736240.git.jpoimboe@redhat.com

Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
0b9301fb
Name Last commit Last update
..
accounting delayacct: track delays from thrashing cache pages
arch tools headers barrier: Fix arm64 tools build failure wrt smp_load_{acquire,release}
bpf tools: bpftool: fix completion for "bpftool map update"
build Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
cgroup tools: fix cross-compile var clobbering
crypto crypto: tools - Add cryptostat userspace
firewire License cleanup: add SPDX GPL-2.0 license identifier to files with no license
gpio Merge tag 'v4.16-rc5' into devel
hv tools: hv: fcopy: set 'error' in case an unknown operation was requested
iio iio: Add modifier for DUV light
include Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
kvm/kvm_stat tools/kvm_stat: cut down decimal places in update interval dialog
laptop tools: fix cross-compile var clobbering
leds tools: fix cross-compile var clobbering
lib Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
memory-model tools/memory-model: Add more LKMM limitations
nfsd License cleanup: add SPDX GPL-2.0 license identifier to files with no license
objtool objtool: Fix double-free in .cold detection error path
pci tools: PCI: Change pcitest compiling process
pcmcia License cleanup: add SPDX GPL-2.0 license identifier to files with no license
perf Merge tag 'perf-urgent-for-mingo-4.20-20181106' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
power Merge branch 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
scripts Kbuild: fix # escaping in .cmd files for future Make
spi spi: spidev_test: Improve decoded text part of hex dump
testing Merge tag 'libnvdimm-fixes-4.20-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm
thermal/tmon
time
usb
virtio
vm
wmi
Makefile