arm: don't call addr_limit_user_check for nommu

From: Christoph Hellwig
Date: Mon Jul 20 2020 - 11:46:50 EST


On arm nommu kernel use the same constant for USER_DS and KERNEL_DS,
and seqment_eq always returns false. With the current check in
addr_limit_user_check that works by accident, but when replacing
seqment_eq with uaccess_kerne it will fail. Just remove the not
needed check entirely.

Signed-off-by: Christoph Hellwig <hch@xxxxxx>
Reported-by: Guenter Roeck <linux@xxxxxxxxxxxx>
---
arch/arm/kernel/signal.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index ab2568996ddb0c..c9dc912b83f012 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -713,7 +713,9 @@ struct page *get_signal_page(void)
/* Defer to generic check */
asmlinkage void addr_limit_check_failed(void)
{
+#ifdef CONFIG_MMU
addr_limit_user_check();
+#endif
}

#ifdef CONFIG_DEBUG_RSEQ
--
2.27.0