Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 3ccea47

Browse files
setarcoskees
authored andcommitted
ARM: Remove address checking for MMUless devices
Commit 169f910 ("ARM: 9350/1: fault: Implement copy_from_kernel_nofault_allowed()") added the function to check address before use. However, for devices without MMU, addr > TASK_SIZE will always fail. This patch move this function after the #ifdef CONFIG_MMU statement. Signed-off-by: Yanjun Yang <yangyj.ee@gmail.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218953 Fixes: 169f910 ("ARM: 9350/1: fault: Implement copy_from_kernel_nofault_allowed()") Link: https://lore.kernel.org/r/20240611100947.32241-1-yangyj.ee@gmail.com Signed-off-by: Kees Cook <kees@kernel.org>
1 parent 18c18b1 commit 3ccea47

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/arm/mm/fault.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525

2626
#include "fault.h"
2727

28+
#ifdef CONFIG_MMU
29+
2830
bool copy_from_kernel_nofault_allowed(const void *unsafe_src, size_t size)
2931
{
3032
unsigned long addr = (unsigned long)unsafe_src;
3133

3234
return addr >= TASK_SIZE && ULONG_MAX - addr >= size;
3335
}
3436

35-
#ifdef CONFIG_MMU
36-
3737
/*
3838
* This is useful to dump out the page tables associated with
3939
* 'addr' in mm 'mm'.

0 commit comments

Comments
 (0)