Re: [RFC PATCH] ima: verify mprotect change is consistent with mmap policy

2020-05-05 Thread Mimi Zohar
On Mon, 2020-05-04 at 15:51 -0700, Lakshmi Ramasubramanian wrote: > On 5/4/20 2:17 PM, Mimi Zohar wrote: > > Hi Mimi, > > > +int ima_file_mprotect(struct vm_area_struct *vma, unsigned long prot) > > +{ > > + struct ima_template_desc *template; > > + struct inode *inode; > > + int result =

Re: [RFC PATCH] ima: verify mprotect change is consistent with mmap policy

2020-05-05 Thread Mimi Zohar
Hi Jann, On Tue, 2020-05-05 at 02:15 +0200, Jann Horn wrote: > On Mon, May 4, 2020 at 11:18 PM Mimi Zohar wrote: > > Files can be mmap'ed read/write and later changed to execute to circumvent > > IMA's mmap appraise policy rules. Due to locking issues (mmap semaphore > > would be taken prior to

Re: [RFC PATCH] ima: verify mprotect change is consistent with mmap policy

2020-05-04 Thread Jann Horn
On Mon, May 4, 2020 at 11:18 PM Mimi Zohar wrote: > Files can be mmap'ed read/write and later changed to execute to circumvent > IMA's mmap appraise policy rules. Due to locking issues (mmap semaphore > would be taken prior to i_mutex), files can not be measured or appraised at > this point.

Re: [RFC PATCH] ima: verify mprotect change is consistent with mmap policy

2020-05-04 Thread Lakshmi Ramasubramanian
On 5/4/20 2:17 PM, Mimi Zohar wrote: Hi Mimi, +int ima_file_mprotect(struct vm_area_struct *vma, unsigned long prot) +{ + struct ima_template_desc *template; + struct inode *inode; + int result = 0; + int action; + u32 secid; + int pcr; + + if

[RFC PATCH] ima: verify mprotect change is consistent with mmap policy

2020-05-04 Thread Mimi Zohar
Files can be mmap'ed read/write and later changed to execute to circumvent IMA's mmap appraise policy rules. Due to locking issues (mmap semaphore would be taken prior to i_mutex), files can not be measured or appraised at this point. Eliminate this integrity gap, by denying the mprotect