From: Dave Hansen <dave.hansen@linux.intel.com>
To: Khalid Aziz <khalid.aziz@oracle.com>,
davem@davemloft.net, akpm@linux-foundation.org
Cc: corbet@lwn.net, bob.picco@oracle.com, steven.sistare@oracle.com,
pasha.tatashin@oracle.com, mike.kravetz@oracle.com,
rob.gardner@oracle.com, mingo@kernel.org,
nitin.m.gupta@oracle.com, anthony.yznaga@oracle.com,
kirill.shutemov@linux.intel.com, tom.hromatka@oracle.com,
allen.pais@oracle.com, tklauser@distanz.ch,
shannon.nelson@oracle.com, vijay.ac.kumar@oracle.com,
mhocko@suse.com, jack@suse.cz, punit.agrawal@arm.com,
hughd@google.com, thomas.tai@oracle.com,
ross.zwisler@linux.intel.com, dave.jiang@intel.com,
willy@infradead.org, minchan@kernel.org,
imbrenda@linux.vnet.ibm.com, aarcange@redhat.com,
kstewart@linuxfoundation.org, pombredanne@nexb.com,
tglx@linutronix.de, gregkh@linuxfoundation.org,
nagarathnam.muthusamy@oracle.com, linux@roeck-us.net,
jane.chu@oracle.com, dan.j.williams@intel.com,
jglisse@redhat.com, ktkhai@virtuozzo.com,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, sparclinux@vger.kernel.org,
Khalid Aziz <khalid@gonehiking.org>
Subject: Re: [PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity)
Date: Mon, 5 Mar 2018 13:26:45 -0800 [thread overview]
Message-ID: <098cda37-0e3c-de44-5995-9e5f74b301c6@linux.intel.com> (raw)
In-Reply-To: <84931753-9a84-8624-adb8-95bd05d87d56@oracle.com>
On 03/05/2018 01:14 PM, Khalid Aziz wrote:
> On 03/05/2018 12:22 PM, Dave Hansen wrote:
>> 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?
>>
> Are you suggesting that vma returned by find_vma() could be split or
> merged underneath me if I do not hold mmap_sem and thus make the flag
> check invalid? If so, that is a good point.
Um, yes. You can't walk the vma tree without holding mmap_sem.
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2018-03-05 21:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1519227112.git.khalid.aziz@oracle.com>
[not found] ` <d8602e35e65c8bf6df1a85166bf181536a6f3664.1519227112.git.khalid.aziz@oracle.com>
2018-03-05 19:22 ` [PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity) Dave Hansen
2018-03-05 21:14 ` Khalid Aziz
2018-03-05 21:26 ` Dave Hansen [this message]
2018-03-05 21:31 ` Dave Hansen
2018-03-05 22:55 ` Khalid Aziz
2018-03-05 21:26 ` Dave Hansen
2018-03-05 21:37 ` Khalid Aziz
2018-03-05 21:50 ` Dave Hansen
2018-03-18 15:08 ` [PATCH v12 00/11] Application Data Integrity feature introduced by SPARC M7 David Miller
2018-03-19 15:19 ` Khalid Aziz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=098cda37-0e3c-de44-5995-9e5f74b301c6@linux.intel.com \
--to=dave.hansen@linux.intel.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=allen.pais@oracle.com \
--cc=anthony.yznaga@oracle.com \
--cc=bob.picco@oracle.com \
--cc=corbet@lwn.net \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=davem@davemloft.net \
--cc=gregkh@linuxfoundation.org \
--cc=hughd@google.com \
--cc=imbrenda@linux.vnet.ibm.com \
--cc=jack@suse.cz \
--cc=jane.chu@oracle.com \
--cc=jglisse@redhat.com \
--cc=khalid.aziz@oracle.com \
--cc=khalid@gonehiking.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=kstewart@linuxfoundation.org \
--cc=ktkhai@virtuozzo.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux@roeck-us.net \
--cc=mhocko@suse.com \
--cc=mike.kravetz@oracle.com \
--cc=minchan@kernel.org \
--cc=mingo@kernel.org \
--cc=nagarathnam.muthusamy@oracle.com \
--cc=nitin.m.gupta@oracle.com \
--cc=pasha.tatashin@oracle.com \
--cc=pombredanne@nexb.com \
--cc=punit.agrawal@arm.com \
--cc=rob.gardner@oracle.com \
--cc=ross.zwisler@linux.intel.com \
--cc=shannon.nelson@oracle.com \
--cc=sparclinux@vger.kernel.org \
--cc=steven.sistare@oracle.com \
--cc=tglx@linutronix.de \
--cc=thomas.tai@oracle.com \
--cc=tklauser@distanz.ch \
--cc=tom.hromatka@oracle.com \
--cc=vijay.ac.kumar@oracle.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox