[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230308190423.46491-3-joey.gouly@arm.com>
Date: Wed, 8 Mar 2023 19:04:21 +0000
From: Joey Gouly <joey.gouly@....com>
To: Andrew Morton <akpm@...ux-foundation.org>
CC: <nd@....com>, <acme@...hat.com>, <catalin.marinas@....com>,
<izbyshev@...ras.ru>, <joey.gouly@....com>, <peterx@...hat.com>,
<linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
Shuah Khan <shuah@...nel.org>,
Kees Cook <keescook@...omium.org>
Subject: [PATCH v1 2/4] 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.
Fixes: b507808ebce2 ("mm: implement memory-deny-write-execute as a prctl")
Reported-by: Alexey Izbyshev <izbyshev@...ras.ru>
Link: https://lore.kernel.org/linux-arm-kernel/8408d8901e9d7ee6b78db4c6cba04b78@ispras.ru/
Signed-off-by: Joey Gouly <joey.gouly@....com>
Cc: Catalin Marinas <catalin.marinas@....com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
---
mm/mprotect.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/mprotect.c b/mm/mprotect.c
index 231929f119d9..13e84d8c0797 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 */
--
2.17.1
Powered by blists - more mailing lists