]> git.itanic.dy.fi Git - linux-stable/commit
xtensa: fix uaccess-related livelock in do_page_fault
authorMax Filippov <jcmvbkbc@gmail.com>
Sun, 7 Feb 2021 12:57:58 +0000 (04:57 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Apr 2021 13:02:30 +0000 (15:02 +0200)
commitdfb1cbe10d6778759a4cd081f2585868140f058f
treeac48af8f5a2b6489951ab849137d5acb0d976323
parentc8b157ed13075031802909eda1388b0519c6d246
xtensa: fix uaccess-related livelock in do_page_fault

commit 7b9acbb6aad4f54623dcd4bd4b1a60fe0c727b09 upstream.

If a uaccess (e.g. get_user()) triggers a fault and there's a
fault signal pending, the handler will return to the uaccess without
having performed a uaccess fault fixup, and so the CPU will immediately
execute the uaccess instruction again, whereupon it will livelock
bouncing between that instruction and the fault handler.

https://lore.kernel.org/lkml/20210121123140.GD48431@C02TD0UTHF1T.local/

Cc: stable@vger.kernel.org
Reported-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/xtensa/mm/fault.c