Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1557025

Re: [PATCH v4 0/4] Application Data Integrity feature introduced by SPARC M7

From Khalid Aziz <khalid.aziz@oracle.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4 0/4] Application Data Integrity feature introduced by SPARC M7
Date 2017-01-12 01:30 +0100
Message-ID <sYBrc-5sK-19@gated-at.bofh.it> (permalink)
References (1 earlier) <sYu6l-Lo-1@gated-at.bofh.it> <sYupI-Sq-29@gated-at.bofh.it> <sYvF8-1NE-23@gated-at.bofh.it> <sYwhQ-21a-31@gated-at.bofh.it> <sYwBe-2p2-129@gated-at.bofh.it>
Organization Oracle Corp

Show all headers | View raw


On 01/11/2017 12:11 PM, Dave Hansen wrote:
> On 01/11/2017 10:50 AM, Khalid Aziz wrote:
>> On 01/11/2017 11:13 AM, Dave Hansen wrote:
>>> On 01/11/2017 08:56 AM, Khalid Aziz wrote:
>>> For memory shared by two different processes, do they have to agree on
>>> what the tags are, or can they differ?
>>
>> The two processes have to agree on the tag. This is part of the security
>> design to prevent other processes from accessing pages belonging to
>> another process unless they know the tag set on those pages.
>
> So what do you do with static data, say from a shared executable?  You
> need to ensure that two different processes from two different privilege
> domains can't set different tags on the same physical memory.  That
> would seem to mean that you must not allow tags to be set of memory
> unless you have write access to it.  Or, you have to ensure that any
> file that you might want to use this feature on is entirely unreadable
> (well, un-mmap()-able really) by anybody that you are not coordinating with.

All of the tag coordination can happen in userspace. Once a process sets 
a tag on a physical page mapped in its address space, another process 
that has mapped the same physical page in its address space can only set 
the tag to exact same value. Attempts to set a different tag are caught 
by memory controller and result in MCD trap and kernel sends SIGSEGV to 
the process trying to set a different tag.

>
> If you want to use it on copy-on-write'able data, you've got to ensure
> that you've got entirely private copies.  I'm not sure we even have an
> interface to guarantee that.  How could this work after a fork() on
> un-COW'd, but COW'able data?

On COW, kernel maps the the source and destination pages with 
kmap_atomic() and copies the data over to the new page and the new page 
wouldn't be ADI protected unless the child process chooses to do so. 
This wouldn't change with ADI as far as private copies are concerned. 
Please do correct me if I get something wrong here. Quick tests with COW 
data show everything working as expected but your asking about COW has 
raised a few questions in my own mind. I am researching through docs and 
running experiments to validate my thinking and I will give you more 
definite information on whether COW would mess ADI up.

Thanks,
Khalid

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v4 0/4] Application Data Integrity feature introduced by SPARC M7 Khalid Aziz <khalid.aziz@oracle.com> - 2017-01-11 17:20 +0100
  [PATCH v4 1/4] signals, sparc: Add signal codes for ADI violations Khalid Aziz <khalid.aziz@oracle.com> - 2017-01-11 17:20 +0100
  Re: [PATCH v4 0/4] Application Data Integrity feature introduced by  SPARC M7 Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-11 17:40 +0100
    Re: [PATCH v4 0/4] Application Data Integrity feature introduced by  SPARC M7 Khalid Aziz <khalid.aziz@oracle.com> - 2017-01-11 18:00 +0100
      Re: [PATCH v4 0/4] Application Data Integrity feature introduced by  SPARC M7 Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-11 19:20 +0100
        Re: [PATCH v4 0/4] Application Data Integrity feature introduced by  SPARC M7 Khalid Aziz <khalid.aziz@oracle.com> - 2017-01-11 20:00 +0100
          Re: [PATCH v4 0/4] Application Data Integrity feature introduced by  SPARC M7 Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-11 20:20 +0100
            Re: [PATCH v4 0/4] Application Data Integrity feature introduced by  SPARC M7 Khalid Aziz <khalid.aziz@oracle.com> - 2017-01-12 01:30 +0100
              Re: [PATCH v4 0/4] Application Data Integrity feature introduced by  SPARC M7 Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-12 01:50 +0100
                Re: [PATCH v4 0/4] Application Data Integrity feature introduced by  SPARC M7 Khalid Aziz <khalid.aziz@oracle.com> - 2017-01-12 18:00 +0100
                Re: [PATCH v4 0/4] Application Data Integrity feature introduced by  SPARC M7 Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-12 19:00 +0100
                Re: [PATCH v4 0/4] Application Data Integrity feature introduced by  SPARC M7 Khalid Aziz <khalid.aziz@oracle.com> - 2017-01-13 01:30 +0100
                Re: [PATCH v4 0/4] Application Data Integrity feature introduced by  SPARC M7 Rob Gardner <rob.gardner@oracle.com> - 2017-01-13 02:40 +0100
                Re: [PATCH v4 0/4] Application Data Integrity feature introduced by  SPARC M7 Khalid Aziz <khalid.aziz@oracle.com> - 2017-01-13 15:50 +0100
                Re: [PATCH v4 0/4] Application Data Integrity feature introduced by  SPARC M7 Rob Gardner <rob.gardner@oracle.com> - 2017-01-13 16:40 +0100
                Re: [PATCH v4 0/4] Application Data Integrity feature introduced by  SPARC M7 Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-13 17:10 +0100
                Re: [PATCH v4 0/4] Application Data Integrity feature introduced by  SPARC M7 Rob Gardner <rob.gardner@oracle.com> - 2017-01-13 18:40 +0100
                Re: [PATCH v4 0/4] Application Data Integrity feature introduced by  SPARC M7 Khalid Aziz <khalid.aziz@oracle.com> - 2017-01-13 17:10 +0100

csiph-web