Skip to contentSkip to conversation

lib-add-might_fault-to-strncpy_from_user.patch removed from -mm tree

merged [email protected] 1 participant 1 message Jun 5, 2020

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: lib: Add might_fault() to strncpy_from_user.
has been removed from the -mm tree. Its filename was
lib-add-might_fault-to-strncpy_from_user.patch

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

------------------------------------------------------
From: KP Singh <[email protected]>
Subject: lib: Add might_fault() to strncpy_from_user.

From: KP Singh <[email protected]>

When updating a piece of broken logic from using get_user to strncpy_from_user, we noticed that a warning which is expected when calling a function that might fault from an atomic context with pagefaults enabled disappeared.

Not having this warning in place can lead to calling strncpy_from_user from an atomic context and eventually kernel crashes/stack corruption.

---

 lib/strncpy_from_user.c |    1 +
 1 file changed, 1 insertion(+)
lib/strncpy_from_user.c renamed from lib/strncpy_from_user.c~lib-add-might_fault-to-strncpy_from_user +1 -0
@@ -98,6 +98,7 @@ long strncpy_from_user(char *dst, const
 {
 	unsigned long max_addr, src_addr;
 
+	might_fault();
 	if (unlikely(count <= 0))
 		return 0;
 

_

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