mm: fix error handling for map_deny_write_exec
authorJoey Gouly <joey.gouly@arm.com>
Wed, 8 Mar 2023 19:04:21 +0000 (19:04 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 24 Mar 2023 00:18:33 +0000 (17:18 -0700)
commit3d27a95b1d96757e48ce970baa3d419af299c2af
tree26e373d94bc85311d26a23916f4cfb9147cc59c7
parent6bbf1090672673183a98cd6e19de91fa5a319df0
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 <joey.gouly@arm.com>
Reported-by: Alexey Izbyshev <izbyshev@ispras.ru>
Link: https://lore.kernel.org/linux-arm-kernel/8408d8901e9d7ee6b78db4c6cba04b78@ispras.ru/
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: nd <nd@arm.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/mprotect.c