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:00:09 +0000 (15:00 +0200)
commita3be911a5feed914233ec2fdc23b0103e616a142
tree51743337e7dc5a9835ca408a6dd2c8a6091351d2
parentbcd7999c03ed4617dedcf9b2ad09a6e7f7cf5150
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