From: "tip-bot2 for Andrii Nakryiko" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Andrii Nakryiko <andrii@kernel.org>,
Ingo Molnar <mingo@kernel.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: perf/core] uprobes: Guard against kmemdup() failing in dup_return_instance()
Date: Mon, 09 Dec 2024 10:32:07 -0000 [thread overview]
Message-ID: <173374032793.412.1283775556101446957.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20241206183436.968068-1-andrii@kernel.org>
The following commit has been merged into the perf/core branch of tip:
Commit-ID: 638331f34c3f19f5bf14611ec6092ca1ba0ceb51
Gitweb: https://git.kernel.org/tip/638331f34c3f19f5bf14611ec6092ca1ba0ceb51
Author: Andrii Nakryiko <andrii@kernel.org>
AuthorDate: Fri, 06 Dec 2024 10:34:36 -08:00
Committer: Peter Zijlstra <peterz@infradead.org>
CommitterDate: Mon, 09 Dec 2024 11:18:08 +01:00
uprobes: Guard against kmemdup() failing in dup_return_instance()
If kmemdup() failed to alloc memory, don't proceed with extra_consumers
copy.
Fixes: e62f2d492728 ("uprobes: Simplify session consumer tracking")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20241206183436.968068-1-andrii@kernel.org
---
kernel/events/uprobes.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index 1af9502..1f75a2f 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -2048,6 +2048,8 @@ static struct return_instance *dup_return_instance(struct return_instance *old)
struct return_instance *ri;
ri = kmemdup(old, sizeof(*ri), GFP_KERNEL);
+ if (!ri)
+ return NULL;
if (unlikely(old->cons_cnt > 1)) {
ri->extra_consumers = kmemdup(old->extra_consumers,
next prev parent reply other threads:[~2024-12-09 10:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-06 18:34 [PATCH perf/core] uprobes: guard " Andrii Nakryiko
2024-12-06 19:01 ` [tip: perf/core] uprobes: Guard " tip-bot2 for Andrii Nakryiko
2024-12-09 10:32 ` tip-bot2 for Andrii Nakryiko [this message]
2024-12-09 11:13 ` [PATCH perf/core] uprobes: guard " Masami Hiramatsu
2024-12-09 14:55 ` [tip: perf/core] uprobes: Guard " tip-bot2 for Andrii Nakryiko
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=173374032793.412.1283775556101446957.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=andrii@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=x86@kernel.org \
/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®