mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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: Fri, 06 Dec 2024 19:01:48 -0000	[thread overview]
Message-ID: <173351170826.412.8773509875179863982.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:     64fb80679287a6dd0acd9c8afa259054a2479a52
Gitweb:        https://git.kernel.org/tip/64fb80679287a6dd0acd9c8afa259054a2479a52
Author:        Andrii Nakryiko <andrii@kernel.org>
AuthorDate:    Fri, 06 Dec 2024 10:34:36 -08:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Fri, 06 Dec 2024 19:52:47 +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,

  reply	other threads:[~2024-12-06 19:01 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-bot2 for Andrii Nakryiko [this message]
2024-12-09 10:32 ` [tip: perf/core] uprobes: Guard " tip-bot2 for Andrii Nakryiko
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=173351170826.412.8773509875179863982.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®