From: Gaurav Singh <gaurav1086@gmail.com>
To: gaurav1086@gmail.com, Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
Tommi Rantala <tommi.t.rantala@nokia.com>,
Thomas Gleixner <tglx@linutronix.de>,
linux-kernel@vger.kernel.org (open list:PERFORMANCE EVENTS
SUBSYSTEM)
Subject: [PATCH] [perf] Fix null pointer deference in nest_epollfd
Date: Wed, 17 Jun 2020 20:38:49 -0400 [thread overview]
Message-ID: <20200618003916.26644-1-gaurav1086@gmail.com> (raw)
Add a NULL check for worker before dereferencing.
Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>
---
tools/perf/bench/epoll-wait.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/perf/bench/epoll-wait.c b/tools/perf/bench/epoll-wait.c
index 75dca9773186..42983eb7f82e 100644
--- a/tools/perf/bench/epoll-wait.c
+++ b/tools/perf/bench/epoll-wait.c
@@ -239,6 +239,9 @@ static void *workerfn(void *arg)
static void nest_epollfd(struct worker *w)
{
+ if (!w)
+ return;
+
unsigned int i;
struct epoll_event ev;
int efd = multiq ? w->epollfd : epollfd;
--
2.17.1
next reply other threads:[~2020-06-18 0:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-18 0:38 Gaurav Singh [this message]
2020-06-18 14:48 ` Namhyung Kim
[not found] ` <CAFAFadA3rRQxw9nyGnhn7kshRfQ_2AN+d-eCwHF-HJ_bYfYVog@mail.gmail.com>
2020-06-19 13:12 ` Namhyung Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200618003916.26644-1-gaurav1086@gmail.com \
--to=gaurav1086@gmail.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=tommi.t.rantala@nokia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®