lkml.org 
[lkml]   [2023]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v1 2/4] mm: fix error handling for map_deny_write_exec
Date
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@ispras.ru>
Link: https://lore.kernel.org/linux-arm-kernel/8408d8901e9d7ee6b78db4c6cba04b78@ispras.ru/
Signed-off-by: Joey Gouly <joey.gouly@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Andrew Morton <akpm@linux-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
\
 
 \ /
  Last update: 2023-03-27 00:50    [W:1.271 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site