Re: [PATCH v40 10/24] mm: Add 'mprotect' hook to struct vm_operations_struct

2020-11-20 Thread Dr. Greg
On Wed, Nov 18, 2020 at 07:39:50PM -0600, Haitao Huang wrote: Good morning, I hope the week is ending well for everyone. > On Mon, 16 Nov 2020 12:00:23 -0600, Dr. Greg wrote: > > >On Thu, Nov 12, 2020 at 02:41:00PM -0800, Andy Lutomirski wrote: > >>It certainly prevents any scheme in which an

Re: [PATCH v40 10/24] mm: Add 'mprotect' hook to struct vm_operations_struct

2020-11-18 Thread Haitao Huang
On Mon, 16 Nov 2020 12:00:23 -0600, Dr. Greg wrote: On Thu, Nov 12, 2020 at 02:41:00PM -0800, Andy Lutomirski wrote: Good morning, I hope the week is starting well for everyone. On Thu, Nov 12, 2020 at 1:31 PM Dave Hansen wrote: > > On 11/12/20 12:58 PM, Dr. Greg wrote: > > @@ -270,11

Re: [PATCH v40 10/24] mm: Add 'mprotect' hook to struct vm_operations_struct

2020-11-16 Thread Dr. Greg
On Thu, Nov 12, 2020 at 02:41:00PM -0800, Andy Lutomirski wrote: Good morning, I hope the week is starting well for everyone. > On Thu, Nov 12, 2020 at 1:31 PM Dave Hansen wrote: > > > > On 11/12/20 12:58 PM, Dr. Greg wrote: > > > @@ -270,11 +270,10 @@ static int sgx_vma_mprotect(struct

Re: [PATCH v40 10/24] mm: Add 'mprotect' hook to struct vm_operations_struct

2020-11-15 Thread Dr. Greg
On Thu, Nov 12, 2020 at 01:31:19PM -0800, Dave Hansen wrote: Good afternoon to everyone. > On 11/12/20 12:58 PM, Dr. Greg wrote: > > @@ -270,11 +270,10 @@ static int sgx_vma_mprotect(struct vm_area_struct > > *vma, > > struct vm_area_struct **pprev, unsigned long start,

Re: [PATCH v40 10/24] mm: Add 'mprotect' hook to struct vm_operations_struct

2020-11-12 Thread Andy Lutomirski
On Thu, Nov 12, 2020 at 1:31 PM Dave Hansen wrote: > > On 11/12/20 12:58 PM, Dr. Greg wrote: > > @@ -270,11 +270,10 @@ static int sgx_vma_mprotect(struct vm_area_struct > > *vma, > > struct vm_area_struct **pprev, unsigned long > > start, > >

Re: [PATCH v40 10/24] mm: Add 'mprotect' hook to struct vm_operations_struct

2020-11-12 Thread Dave Hansen
On 11/12/20 12:58 PM, Dr. Greg wrote: > @@ -270,11 +270,10 @@ static int sgx_vma_mprotect(struct vm_area_struct *vma, > struct vm_area_struct **pprev, unsigned long start, > unsigned long end, unsigned long newflags) > { > - int ret; > +

Re: [PATCH v40 10/24] mm: Add 'mprotect' hook to struct vm_operations_struct

2020-11-12 Thread Dr. Greg
On Sat, Nov 07, 2020 at 11:16:25AM -0800, Dave Hansen wrote: Good afternoon, I hope the week is going well for everyone. > On 11/7/20 7:09 AM, Dr. Greg wrote: > > In all of these discussions there hasn't been a refutation of my point > > that the only reason this hook is needed is to stop the

Re: [PATCH v40 10/24] mm: Add 'mprotect' hook to struct vm_operations_struct

2020-11-07 Thread Dave Hansen
On 11/7/20 7:09 AM, Dr. Greg wrote: > In all of these discussions there hasn't been a refutation of my point > that the only reason this hook is needed is to stop the potential for > anonymous code execution on SGX2 capable hardware. So we will assume, > that while unspoken, this is the rationale

Re: [PATCH v40 10/24] mm: Add 'mprotect' hook to struct vm_operations_struct

2020-11-07 Thread Dr. Greg
On Fri, Nov 06, 2020 at 09:13:11PM +, Matthew Wilcox wrote: > On Fri, Nov 06, 2020 at 11:43:59AM -0600, Dr. Greg wrote: > > The 900 pound primate in the room, that no one is acknowledging, is > > that this technology was designed to not allow the operating system to > > have any control over

Re: [PATCH v40 10/24] mm: Add 'mprotect' hook to struct vm_operations_struct

2020-11-07 Thread Dr. Greg
On Fri, Nov 06, 2020 at 09:54:19AM -0800, Dave Hansen wrote: Good morning, I hope the weekend is going well for everyone, beautiful weather out here in West-Cental Minnesota. > On 11/6/20 9:43 AM, Dr. Greg wrote: > > In light of this, given the decision by the driver authors to not > > fully

Re: [PATCH v40 10/24] mm: Add 'mprotect' hook to struct vm_operations_struct

2020-11-06 Thread Borislav Petkov
On Sat, Nov 07, 2020 at 12:04:02AM +0200, Jarkko Sakkinen wrote: > There has been a change request to update callback that made perfect > sense to me. Is there something else that I might have missed? Just > checking. With "change requests" I mean the usual going through the replies to a patchset

Re: [PATCH v40 10/24] mm: Add 'mprotect' hook to struct vm_operations_struct

2020-11-06 Thread Jarkko Sakkinen
On Fri, Nov 06, 2020 at 09:37:25PM +0100, Borislav Petkov wrote: > On Fri, Nov 06, 2020 at 06:51:07PM +0200, Jarkko Sakkinen wrote: > > Both comments make sense to me. I'll refine this patch on Monday and > > And while you're at it, I'd suggest you refine the whole patchset and > send a full v41

Re: [PATCH v40 10/24] mm: Add 'mprotect' hook to struct vm_operations_struct

2020-11-06 Thread Dave Hansen
On 11/6/20 1:13 PM, Matthew Wilcox wrote: > On Fri, Nov 06, 2020 at 11:43:59AM -0600, Dr. Greg wrote: >> The 900 pound primate in the room, that no one is acknowledging, is >> that this technology was designed to not allow the operating system to >> have any control over what it is doing. In the

Re: [PATCH v40 10/24] mm: Add 'mprotect' hook to struct vm_operations_struct

2020-11-06 Thread Matthew Wilcox
On Fri, Nov 06, 2020 at 11:43:59AM -0600, Dr. Greg wrote: > The 900 pound primate in the room, that no one is acknowledging, is > that this technology was designed to not allow the operating system to > have any control over what it is doing. In the mindset of kernel > developers, the operating

Re: [PATCH v40 10/24] mm: Add 'mprotect' hook to struct vm_operations_struct

2020-11-06 Thread Borislav Petkov
On Fri, Nov 06, 2020 at 06:51:07PM +0200, Jarkko Sakkinen wrote: > Both comments make sense to me. I'll refine this patch on Monday and And while you're at it, I'd suggest you refine the whole patchset and send a full v41 instead: - please audit all your Reviewed-by, Acked-by tags as to for what

Re: [PATCH v40 10/24] mm: Add 'mprotect' hook to struct vm_operations_struct

2020-11-06 Thread Dave Hansen
On 11/6/20 9:43 AM, Dr. Greg wrote: > In light of this, given the decision by the driver authors to not > fully equip the driver with EDMM support, the mprotect protection > requirements are straight forward and minimalistic. All that is > needed is a binary valued variable, set on the

Re: [PATCH v40 10/24] mm: Add 'mprotect' hook to struct vm_operations_struct

2020-11-06 Thread Dr. Greg
On Wed, Nov 04, 2020 at 04:54:16PM +0200, Jarkko Sakkinen wrote: Good morning, I hope the week has gone well for everyone. > From: Sean Christopherson > > Background > == > > 1. SGX enclave pages are populated with data by copying from normal memory >via ioctl()

Re: [PATCH v40 10/24] mm: Add 'mprotect' hook to struct vm_operations_struct

2020-11-06 Thread Jarkko Sakkinen
On Fri, Nov 06, 2020 at 10:04:09AM +, Mel Gorman wrote: > On Wed, Nov 04, 2020 at 04:54:16PM +0200, Jarkko Sakkinen wrote: > > From: Sean Christopherson > > > > Background > > == > > > > 1. SGX enclave pages are populated with data by copying from normal memory > >via ioctl()

Re: [PATCH v40 10/24] mm: Add 'mprotect' hook to struct vm_operations_struct

2020-11-06 Thread Mel Gorman
On Wed, Nov 04, 2020 at 04:54:16PM +0200, Jarkko Sakkinen wrote: > From: Sean Christopherson > > Background > == > > 1. SGX enclave pages are populated with data by copying from normal memory >via ioctl() (SGX_IOC_ENCLAVE_ADD_PAGES), which will be added later in >this series. >

Re: [PATCH v40 10/24] mm: Add 'mprotect' hook to struct vm_operations_struct

2020-11-05 Thread Dave Hansen
On 11/5/20 8:04 AM, Borislav Petkov wrote: ... >> Add a vm_ops->mprotect() hook so that mprotect() operations which are >> inconsistent with any page's stashed intent can be rejected by the driver. >> >> Cc: linux...@kvack.org >> Cc: Andrew Morton >> Cc: Matthew Wilcox >> Acked-by: Jethro

Re: [PATCH v40 10/24] mm: Add 'mprotect' hook to struct vm_operations_struct

2020-11-05 Thread Borislav Petkov
On Wed, Nov 04, 2020 at 04:54:16PM +0200, Jarkko Sakkinen wrote: > From: Sean Christopherson > > Background > == > > 1. SGX enclave pages are populated with data by copying from normal memory >via ioctl() (SGX_IOC_ENCLAVE_ADD_PAGES), which will be added later in >this series. >

[PATCH v40 10/24] mm: Add 'mprotect' hook to struct vm_operations_struct

2020-11-04 Thread Jarkko Sakkinen
From: Sean Christopherson Background == 1. SGX enclave pages are populated with data by copying from normal memory via ioctl() (SGX_IOC_ENCLAVE_ADD_PAGES), which will be added later in this series. 2. It is desirable to be able to restrict those normal memory data sources. For