Re: [PATCH] powerpc/pkeys: copy pkey-tracking-information at fork()

2018-12-20 Thread Ram Pai
On Fri, Dec 21, 2018 at 12:19:13AM +1100, Michael Ellerman wrote: > Hi Ram, > > Thanks for fixing this. > > Ram Pai writes: > > diff --git a/arch/powerpc/mm/pkeys.c b/arch/powerpc/mm/pkeys.c > > index b271b28..5d65c47 100644 > > --- a/arch/powerpc/mm/pkeys.c > > +++ b/arch/powerpc/mm/pkeys.c > >

Re: [PATCH] powerpc/pkeys: copy pkey-tracking-information at fork()

2018-12-20 Thread Michael Ellerman
Hi Ram, Thanks for fixing this. Ram Pai writes: > diff --git a/arch/powerpc/mm/pkeys.c b/arch/powerpc/mm/pkeys.c > index b271b28..5d65c47 100644 > --- a/arch/powerpc/mm/pkeys.c > +++ b/arch/powerpc/mm/pkeys.c > @@ -414,3 +414,10 @@ bool arch_vma_access_permitted(struct vm_area_struct > *vma, bo

Re: [PATCH] powerpc/pkeys: copy pkey-tracking-information at fork()

2018-12-04 Thread Florian Weimer
* Ram Pai: > +void arch_dup_pkeys(struct mm_struct *oldmm, struct mm_struct *mm) > +{ > + /* Duplicate the oldmm pkey state in mm: */ > + mm_pkey_allocation_map(mm) = mm_pkey_allocation_map(oldmm); > + mm->context.execute_only_pkey = oldmm->context.execute_only_pkey; > +} Looks reason

Re: [PATCH] powerpc/pkeys: copy pkey-tracking-information at fork()

2018-12-03 Thread Thiago Jung Bauermann
Ram Pai writes: > At fork(), the pkey tracking information is not copied over > to the mm_struct of the child. This can cause the child to erroneously > allocate keys that were already allocated. Any allocated execute-only > key is lost aswell. > > Add code; called by dup_mmap(), to copy the pk

[PATCH] powerpc/pkeys: copy pkey-tracking-information at fork()

2018-12-03 Thread Ram Pai
At fork(), the pkey tracking information is not copied over to the mm_struct of the child. This can cause the child to erroneously allocate keys that were already allocated. Any allocated execute-only key is lost aswell. Add code; called by dup_mmap(), to copy the pkey state from parent to child e