]> www.infradead.org Git - users/dwmw2/linux.git/commit
riscv: Fix perf record without libelf support
authorMao Han <han_mao@c-sky.com>
Thu, 11 Jul 2019 02:38:40 +0000 (10:38 +0800)
committerSasha Levin <sashal@kernel.org>
Sun, 25 Aug 2019 14:10:31 +0000 (10:10 -0400)
commit1b6336c844dc7f1f962086c25d6fac9dce178515
treec89561cbba2773cc21661e0a6ff75514dff43fc4
parent174cde5be1a83dc59af9fbf89176ee091b0be612
riscv: Fix perf record without libelf support

[ Upstream commit b399abe7c21e248dc6224cadc9a378a2beb10cfd ]

This patch fix following perf record error by linking vdso.so with
build id.

perf.data      perf.data.old
[ perf record: Woken up 1 times to write data ]
free(): double free detected in tcache 2
Aborted

perf record use filename__read_build_id(util/symbol-minimal.c) to get
build id when libelf is not supported. When vdso.so is linked without
build id, the section size of PT_NOTE will be zero, buf size will
realloc to zero and cause memory corruption.

Signed-off-by: Mao Han <han_mao@c-sky.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Palmer Dabbelt <palmer@sifive.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/riscv/kernel/vdso/Makefile