]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
futex: Ensure that futex address is aligned in handle_futex_death()
authorChen Jie <chenjie6@huawei.com>
Fri, 15 Mar 2019 03:44:38 +0000 (03:44 +0000)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit087fad77a7fd074ceaa253bd9e8459f4c2964c45
tree31be87efa4f2d14e02d00e47904d6c404309014a
parent65dd672d0bfe65d0604a2a3ec31c2367fdf5bce0
futex: Ensure that futex address is aligned in handle_futex_death()

BugLink: https://bugs.launchpad.net/bugs/1838116
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 <chenjie6@huawei.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: <dvhart@infradead.org>
Cc: <peterz@infradead.org>
Cc: <zengweilin@huawei.com>
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 <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
kernel/futex.c