From: Joey Gouly Date: Wed, 8 Mar 2023 19:04:21 +0000 (+0000) Subject: mm: fix error handling for map_deny_write_exec X-Git-Tag: v6.6.17~5246^2~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3d27a95b1d96757e48ce970baa3d419af299c2af;p=platform%2Fkernel%2Flinux-rpi.git mm: fix error handling for map_deny_write_exec Commit 4a18419f71cd ("mm/mprotect: use mmu_gather") changed 'goto out;' to 'break' in the loop. This wasn't noticed while rebasing the MDWE patches, so fix it now. Link: https://lkml.kernel.org/r/20230308190423.46491-3-joey.gouly@arm.com Fixes: b507808ebce2 ("mm: implement memory-deny-write-execute as a prctl") Signed-off-by: Joey Gouly Reported-by: Alexey Izbyshev Link: https://lore.kernel.org/linux-arm-kernel/8408d8901e9d7ee6b78db4c6cba04b78@ispras.ru/ Reviewed-by: Catalin Marinas Cc: Arnaldo Carvalho de Melo Cc: Kees Cook Cc: nd Cc: Peter Xu Cc: Shuah Khan Signed-off-by: Andrew Morton --- diff --git a/mm/mprotect.c b/mm/mprotect.c index 231929f..13e84d8 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c @@ -805,7 +805,7 @@ static int do_mprotect_pkey(unsigned long start, size_t len, if (map_deny_write_exec(vma, newflags)) { error = -EACCES; - goto out; + break; } /* Allow architectures to sanity-check the new flags */