From: Greg Kroah-Hartman Date: Sun, 24 Mar 2019 20:15:35 +0000 (+0100) Subject: 3.18-stable patches X-Git-Tag: v4.9.166~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=56bc4bca9f33f2609ad3ba8cbfa10a629ee33d5b;p=thirdparty%2Fkernel%2Fstable-queue.git 3.18-stable patches added patches: futex-ensure-that-futex-address-is-aligned-in-handle_futex_death.patch --- diff --git a/queue-3.18/futex-ensure-that-futex-address-is-aligned-in-handle_futex_death.patch b/queue-3.18/futex-ensure-that-futex-address-is-aligned-in-handle_futex_death.patch new file mode 100644 index 00000000000..e938d1b9cb6 --- /dev/null +++ b/queue-3.18/futex-ensure-that-futex-address-is-aligned-in-handle_futex_death.patch @@ -0,0 +1,47 @@ +From 5a07168d8d89b00fe1760120714378175b3ef992 Mon Sep 17 00:00:00 2001 +From: Chen Jie +Date: Fri, 15 Mar 2019 03:44:38 +0000 +Subject: futex: Ensure that futex address is aligned in handle_futex_death() + +From: Chen Jie + +commit 5a07168d8d89b00fe1760120714378175b3ef992 upstream. + +The futex code requires that the user space addresses of futexes are 32bit +aligned. sys_futex() checks this in futex_get_keys() but the robust list +code has no alignment check in place. + +As a consequence the kernel crashes on architectures with strict alignment +requirements in handle_futex_death() when trying to cmpxchg() on an +unaligned futex address which was retrieved from the robust list. + +[ tglx: Rewrote changelog, proper sizeof() based alignement check and add + comment ] + +Fixes: 0771dfefc9e5 ("[PATCH] lightweight robust futexes: core") +Signed-off-by: Chen Jie +Signed-off-by: Thomas Gleixner +Cc: +Cc: +Cc: +Cc: stable@vger.kernel.org +Link: https://lkml.kernel.org/r/1552621478-119787-1-git-send-email-chenjie6@huawei.com +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/futex.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/kernel/futex.c ++++ b/kernel/futex.c +@@ -2897,6 +2897,10 @@ int handle_futex_death(u32 __user *uaddr + { + u32 uval, uninitialized_var(nval), mval; + ++ /* Futex address must be 32bit aligned */ ++ if ((((unsigned long)uaddr) % sizeof(*uaddr)) != 0) ++ return -1; ++ + retry: + if (get_user(uval, uaddr)) + return -1; diff --git a/queue-3.18/series b/queue-3.18/series index 0fc7b93b4e6..0e73f67d9a2 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -1 +1,2 @@ udf-fix-crash-on-io-error-during-truncate.patch +futex-ensure-that-futex-address-is-aligned-in-handle_futex_death.patch