Re: [PATCH 2/2] sparc: Check VMA range in sparc_validate_prot()

2020-10-07 Thread Khalid Aziz
On 10/7/20 1:39 AM, Jann Horn wrote: > sparc_validate_prot() is called from do_mprotect_pkey() as > arch_validate_prot(); it tries to ensure that an mprotect() call can't > enable ADI on incompatible VMAs. > The current implementation only checks that the VMA at the start address > matches the rule

Re: [PATCH 2/2] sparc: Check VMA range in sparc_validate_prot()

2020-10-07 Thread Christoph Hellwig
> +++ b/arch/sparc/include/asm/mman.h > @@ -60,31 +60,41 @@ static inline int sparc_validate_prot(unsigned long prot, > unsigned long addr, > if (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC | PROT_SEM | PROT_ADI)) > return 0; > if (prot & PROT_ADI) { > + struc