Skip to contentSkip to conversation

coredump-fix-null-pointer-dereference-on-coredump.patch removed from -mm tree

merged [email protected] 1 participant 1 message Apr 23, 2020 Stable branch

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: coredump: fix null pointer dereference on coredump
has been removed from the -mm tree. Its filename was
coredump-fix-null-pointer-dereference-on-coredump.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Sudip Mukherjee <[email protected]>
Subject: coredump: fix null pointer dereference on coredump

If the core_pattern is set to "|" and any process segfaults then we get a null pointer derefernce while trying to coredump. The call stack shows:

[  108.212680] RIP: 0010:do_coredump+0x628/0x11c0

When the core_pattern has only "|" there is no use of trying the coredump and we can check that while formating the corename and exit with an error.

After this change I get:

[   48.453756] format_corename failed
[   48.453758] Aborting core
Fixes 315c69261dd3 ("coredump: split pipe command whitespace before expanding template")
Cc Paul Wise <[email protected]>
Cc Alexander Viro <[email protected]>
Cc Neil Horman <[email protected]>

---

 fs/coredump.c |    2 ++
 1 file changed, 2 insertions(+)
fs/coredump.c renamed from fs/coredump.c~coredump-fix-null-pointer-dereference-on-coredump +2 -0
@@ -211,6 +211,8 @@ static int format_corename(struct core_n
 			return -ENOMEM;
 		(*argv)[(*argc)++] = 0;
 		++pat_ptr;
+		if (!(*pat_ptr))
+			return -ENOMEM;
 	}
 
 	/* Repeat as long as we have more pattern to process and more output

_

Patches currently in -mm which might be from [email protected] are