[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a59ece97-ba1f-dfb1-bfc8-b44ffd8edbca@linux.intel.com>
Date: Mon, 5 Mar 2018 11:22:08 -0800
From: Dave Hansen <dave.hansen@...ux.intel.com>
To: Khalid Aziz <khalid.aziz@...cle.com>, davem@...emloft.net,
akpm@...ux-foundation.org
Cc: corbet@....net, bob.picco@...cle.com, steven.sistare@...cle.com,
pasha.tatashin@...cle.com, mike.kravetz@...cle.com,
rob.gardner@...cle.com, mingo@...nel.org, nitin.m.gupta@...cle.com,
anthony.yznaga@...cle.com, kirill.shutemov@...ux.intel.com,
tom.hromatka@...cle.com, allen.pais@...cle.com,
tklauser@...tanz.ch, shannon.nelson@...cle.com,
vijay.ac.kumar@...cle.com, mhocko@...e.com, jack@...e.cz,
punit.agrawal@....com, hughd@...gle.com, thomas.tai@...cle.com,
ross.zwisler@...ux.intel.com, dave.jiang@...el.com,
willy@...radead.org, minchan@...nel.org,
imbrenda@...ux.vnet.ibm.com, aarcange@...hat.com,
kstewart@...uxfoundation.org, pombredanne@...b.com,
tglx@...utronix.de, gregkh@...uxfoundation.org,
nagarathnam.muthusamy@...cle.com, linux@...ck-us.net,
jane.chu@...cle.com, dan.j.williams@...el.com, jglisse@...hat.com,
ktkhai@...tuozzo.com, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
sparclinux@...r.kernel.org, Khalid Aziz <khalid@...ehiking.org>
Subject: Re: [PATCH v12 10/11] sparc64: Add support for ADI (Application Data
Integrity)
On 02/21/2018 09:15 AM, Khalid Aziz wrote:
> +#define arch_validate_prot(prot, addr) sparc_validate_prot(prot, addr)
> +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) {
> + if (!adi_capable())
> + return 0;
> +
> + if (addr) {
> + struct vm_area_struct *vma;
> +
> + vma = find_vma(current->mm, addr);
> + if (vma) {
> + /* ADI can not be enabled on PFN
> + * mapped pages
> + */
> + if (vma->vm_flags & (VM_PFNMAP | VM_MIXEDMAP))
> + return 0;
You don't hold mmap_sem here. How can this work?
Powered by blists - more mailing lists