projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d29e744
)
uprobes: Guard against kmemdup() failing in dup_return_instance()
author
Andrii Nakryiko
<andrii@kernel.org>
Fri, 6 Dec 2024 18:34:36 +0000
(10:34 -0800)
committer
Ingo Molnar
<mingo@kernel.org>
Mon, 9 Dec 2024 14:50:32 +0000
(15:50 +0100)
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
patch
|
blob
|
blame
|
history
diff --git
a/kernel/events/uprobes.c
b/kernel/events/uprobes.c
index 1af950208c2b4b469be974d2b90a32fa5b0798b3..1f75a2f9120676c4967791730adb9e9143885b3d 100644
(file)
--- 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,