diff options
author | Khalid Aziz <[email protected]> | 2020-10-23 11:56:11 -0600 |
---|---|---|
committer | David S. Miller <[email protected]> | 2021-02-18 16:37:42 -0800 |
commit | 147d8622f2a26ef34beacc60e1ed8b66c2fa457f (patch) | |
tree | ddba8acb7fcbf6b76353324504328bc3a7508d99 /arch/sparc/kernel/sun4m_irq.c | |
parent | 76962e03934e1a77795852c1d64bd8491a00fb52 (diff) |
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 c462ac288f2c ("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 <[email protected]>
Suggested-by: Christoph Hellwig <[email protected]>
Suggested-by: Catalin Marinas <[email protected]>
Signed-off-by: Khalid Aziz <[email protected]>
Reviewed-by: Catalin Marinas <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'arch/sparc/kernel/sun4m_irq.c')
0 files changed, 0 insertions, 0 deletions