Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1428467
| From | He Kuang <hekuang@huawei.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 5/5] perf tools: Fix NULL pointer deference when vdso not found |
| Date | 2016-06-22 09:00 +0200 |
| Message-ID | <rMKiJ-8pY-3@gated-at.bofh.it> (permalink) |
| References | <rMKiJ-8pY-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
We should check if 'dso' is a null pointer before passing it to the
function dso__type(), otherwise a segfault will be raised in
dso__data_get_fd(). In function machine__find_vdso(), the return value
checking of 'dso' is missed and this patch fixes this issue.
Signed-off-by: He Kuang <hekuang@huawei.com>
---
tools/perf/util/vdso.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/vdso.c b/tools/perf/util/vdso.c
index 8f81c41..7bdcad4 100644
--- a/tools/perf/util/vdso.c
+++ b/tools/perf/util/vdso.c
@@ -296,7 +296,7 @@ static struct dso *machine__find_vdso(struct machine *machine,
if (!dso) {
dso = __dsos__find(&machine->dsos, DSO__NAME_VDSO,
true);
- if (dso_type != dso__type(dso, machine))
+ if (dso && dso_type != dso__type(dso, machine))
dso = NULL;
}
break;
--
1.8.5.2
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH 5/5] perf tools: Fix NULL pointer deference when vdso not found He Kuang <hekuang@huawei.com> - 2016-06-22 09:00 +0200
Re: [PATCH 5/5] perf tools: Fix NULL pointer deference when vdso not found "Wangnan (F)" <wangnan0@huawei.com> - 2016-06-23 04:10 +0200
Re: [PATCH 5/5] perf tools: Fix NULL pointer deference when vdso not found Hekuang <hekuang@huawei.com> - 2016-06-23 05:10 +0200
Re: [PATCH 5/5] perf tools: Fix NULL pointer deference when vdso not found Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-23 14:10 +0200
Re: [PATCH 5/5] perf tools: Fix NULL pointer deference when vdso not found Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-23 15:30 +0200
csiph-web