Skip to contentSkip to conversation

Patch "futex: Move futex_init() to core_initcall" has been added to the 4.4-stable tree

PATCH [email protected] 1 participant 1 message Feb 20, 2017 Stable branch

lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

futex: Move futex_init() to core_initcall

to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
futex-move-futex_init-to-core_initcall.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 25f71d1c3e98ef0e52371746220d66458eac75bc Mon Sep 17 00:00:00 2001

From: Yang Yang <[email protected]>
Date: Fri, 30 Dec 2016 16:17:55 +0800
Subject: futex: Move futex_init() to core_initcall

From: Yang Yang <[email protected]>

commit 25f71d1c3e98ef0e52371746220d66458eac75bc upstream.

The UEVENT user mode helper is enabled before the initcalls are executed and is available when the root filesystem has been mounted.

The user mode helper is triggered by device init calls and the executable might use the futex syscall.

futex_init() is marked __initcall which maps to device_initcall, but there is no guarantee that futex_init() is invoked _before_ the first device init call which triggers the UEVENT user mode helper.

If the user mode helper uses the futex syscall before futex_init() then the syscall crashes with a NULL pointer dereference because the futex subsystem has not been initialized yet.

Move futex_init() to core_initcall so futexes are initialized before the root filesystem is mounted and the usermode helper becomes available.

[ tglx: Rewrote changelog ]

---
 kernel/futex.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/futex.c +1 -1
@@ -3199,4 +3199,4 @@ static int __init futex_init(void)
 
 	return 0;
 }
-__initcall(futex_init);
+core_initcall(futex_init);

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

queue-4.4/futex-move-futex_init-to-core_initcall.patch