linux/arch/sparc
Khalid Aziz 147d8622f2 sparc64: Use arch_validate_flags() to validate ADI flag
When userspace calls mprotect() to enable ADI on an address range,
do_mprotect_pkey() calls arch_validate_prot() to validate new
protection flags. arch_validate_prot() for sparc looks at the first
VMA associated with address range to verify if ADI can indeed be
enabled on this address range. This has two issues - (1) Address
range might cover multiple VMAs while arch_validate_prot() looks at
only the first VMA, (2) arch_validate_prot() peeks at VMA without
holding mmap lock which can result in race condition.

arch_validate_flags() from commit c462ac288f ("mm: Introduce
arch_validate_flags()") allows for VMA flags to be validated for all
VMAs that cover the address range given by user while holding mmap
lock. This patch updates sparc code to move the VMA check from
arch_validate_prot() to arch_validate_flags() to fix above two
issues.

Suggested-by: Jann Horn <jannh@google.com>
Suggested-by: Christoph Hellwig <hch@infradead.org>
Suggested-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Khalid Aziz <khalid.aziz@oracle.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-02-18 16:37:42 -08:00
..
boot sparc: piggyback: handle invalid image 2020-06-22 15:44:44 -07:00
configs sparc: sparc64_defconfig: add necessary configs for qemu 2021-02-18 16:17:39 -08:00
crypto crypto: lib/sha1 - remove unnecessary includes of linux/cryptohash.h 2020-05-08 15:32:17 +10:00
include sparc64: Use arch_validate_flags() to validate ADI flag 2021-02-18 16:37:42 -08:00
kernel sparc: fix led.c driver when PROC_FS is not enabled 2021-02-18 16:31:13 -08:00
lib sparc32: fix a user-triggerable oops in clear_user() 2020-07-21 18:23:55 -07:00
math-emu sparc: Use fallthrough pseudo-keyword 2020-07-21 18:28:00 -07:00
mm sparc32: Fix comparing pointer to 0 coccicheck warning 2021-02-18 16:32:01 -08:00
net treewide: Use sizeof_field() macro 2019-12-09 10:36:44 -08:00
oprofile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
power treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
prom License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vdso mmap locking API: use coccinelle to convert mmap_sem rwsem call sites 2020-06-09 09:39:14 -07:00
Kbuild treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
Kconfig sparc64: only select COMPAT_BINFMT_ELF if BINFMT_ELF is set 2021-02-18 16:28:18 -08:00
Kconfig.debug Kconfig: consolidate the "Kernel hacking" menu 2018-08-02 08:06:48 +09:00
Makefile sparc: generate uapi header and system call table files 2018-11-18 18:52:22 -08:00