[<prev] [next>] [day] [month] [year] [list]
Message-ID: <169814305576.3135.13128124905427948151.tip-bot2@tip-bot2>
Date: Tue, 24 Oct 2023 10:24:15 -0000
From: "tip-bot2 for Peter Zijlstra" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Dan Carpenter <dan.carpenter@...aro.org>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: perf/urgent] perf/core: Fix potential NULL deref
The following commit has been merged into the perf/urgent branch of tip:
Commit-ID: a71ef31485bb51b846e8db8b3a35e432cc15afb5
Gitweb: https://git.kernel.org/tip/a71ef31485bb51b846e8db8b3a35e432cc15afb5
Author: Peter Zijlstra <peterz@...radead.org>
AuthorDate: Tue, 24 Oct 2023 11:42:21 +02:00
Committer: Ingo Molnar <mingo@...nel.org>
CommitterDate: Tue, 24 Oct 2023 12:15:12 +02:00
perf/core: Fix potential NULL deref
Smatch is awesome.
Fixes: 32671e3799ca ("perf: Disallow mis-matched inherited group reads")
Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
kernel/events/core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index d0663b9..a2f2a95 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -13372,7 +13372,8 @@ static int inherit_group(struct perf_event *parent_event,
!perf_get_aux_event(child_ctr, leader))
return -EINVAL;
}
- leader->group_generation = parent_event->group_generation;
+ if (leader)
+ leader->group_generation = parent_event->group_generation;
return 0;
}
Powered by blists - more mailing lists