mbox series

[v1,0/4] Fixes for MDWE prctl

Message ID 20230308190423.46491-1-joey.gouly@arm.com (mailing list archive)
Headers show
Series Fixes for MDWE prctl | expand

Message

Joey Gouly March 8, 2023, 7:04 p.m. UTC
Hi all,

These are four small fixes for the recent memory-write-deny-execute prctl patches [1].
Two reported by Alexey about error handling and two tooling fixes by Peter.

Thanks,
Joey

[1] https://lore.kernel.org/linux-arm-kernel/20230119160344.54358-1-joey.gouly@arm.com/

Joey Gouly (2):
  mm: deduplicate error handling for map_deny_write_exec
  mm: fix error handling for map_deny_write_exec

Peter Xu (2):
  kselftest: vm: fix unused variable warning
  tools headers UAPI: Sync linux/prctl.h with the kernel sources

 mm/mmap.c                              | 7 +------
 mm/mprotect.c                          | 2 +-
 tools/include/uapi/linux/prctl.h       | 6 ++++++
 tools/testing/selftests/mm/mdwe_test.c | 3 +--
 4 files changed, 9 insertions(+), 9 deletions(-)

--
2.17.1

Comments

Catalin Marinas March 13, 2023, 2:11 p.m. UTC | #1
On Wed, Mar 08, 2023 at 07:04:20PM +0000, Joey Gouly wrote:
> Commit cc8d1b097de7 ("mmap: clean up mmap_region() unrolling") deduplicated
> the error handling, do the same for the return value of `map_deny_write_exec`.
> 
> 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>

Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Catalin Marinas March 13, 2023, 2:11 p.m. UTC | #2
On Wed, Mar 08, 2023 at 07:04:21PM +0000, Joey Gouly wrote:
> 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>

Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>