mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joey Gouly <joey.gouly@arm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: <nd@arm.com>, <acme@redhat.com>, <catalin.marinas@arm.com>,
	<izbyshev@ispras.ru>, <joey.gouly@arm.com>, <peterx@redhat.com>,
	<linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>,
	Shuah Khan <shuah@kernel.org>, Kees Cook <keescook@chromium.org>
Subject: [PATCH v1 2/4] mm: fix error handling for map_deny_write_exec
Date: Wed, 8 Mar 2023 19:04:21 +0000	[thread overview]
Message-ID: <20230308190423.46491-3-joey.gouly@arm.com> (raw)
In-Reply-To: <20230308190423.46491-1-joey.gouly@arm.com>

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


  parent reply	other threads:[~2023-03-08 19:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-08 19:04 [PATCH v1 0/4] Fixes for MDWE prctl Joey Gouly
2023-03-08 19:04 ` [PATCH v1 1/4] mm: deduplicate error handling for map_deny_write_exec Joey Gouly
2023-03-13 14:11   ` Catalin Marinas
2023-03-08 19:04 ` Joey Gouly [this message]
2023-03-13 14:11   ` [PATCH v1 2/4] mm: fix " Catalin Marinas
2023-03-08 19:04 ` [PATCH v1 3/4] kselftest: vm: fix unused variable warning Joey Gouly
2023-03-13 14:12   ` Catalin Marinas
2023-03-08 19:04 ` [PATCH v1 4/4] tools headers UAPI: Sync linux/prctl.h with the kernel sources Joey Gouly
2023-03-13 14:13   ` Catalin Marinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230308190423.46491-3-joey.gouly@arm.com \
    --to=joey.gouly@arm.com \
    --cc=acme@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=catalin.marinas@arm.com \
    --cc=izbyshev@ispras.ru \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nd@arm.com \
    --cc=peterx@redhat.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®