Re: [PATCH v4 17/29] arm64: implement PKEYS support

2024-07-25 Thread Dave Martin
On Fri, May 03, 2024 at 02:01:35PM +0100, Joey Gouly wrote: > Implement the PKEYS interface, using the Permission Overlay Extension. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon > --- > arch/arm64/include/asm/mmu.h | 1 + > arch/arm64/include/asm/mmu_context.

Re: [PATCH v4 17/29] arm64: implement PKEYS support

2024-07-22 Thread Anshuman Khandual
On 5/3/24 18:31, Joey Gouly wrote: > Implement the PKEYS interface, using the Permission Overlay Extension. This commit message should contain some more details here considering the amount of code change proposed in this patch. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Dea

Re: [PATCH v4 17/29] arm64: implement PKEYS support

2024-07-22 Thread Kevin Brodsky
On 05/07/2024 18:59, Catalin Marinas wrote: > On Fri, May 03, 2024 at 02:01:35PM +0100, Joey Gouly wrote: >> @@ -163,7 +182,8 @@ static inline pteval_t __phys_to_pte_val(phys_addr_t >> phys) >> #define pte_access_permitted_no_overlay(pte, write) \ >> (((pte_val(pte) & (PTE_VALID | PTE_USER))

Re: [PATCH v4 17/29] arm64: implement PKEYS support

2024-07-18 Thread Szabolcs Nagy
The 07/11/2024 10:50, Joey Gouly wrote: > On Mon, Jul 08, 2024 at 06:53:18PM +0100, Catalin Marinas wrote: > > On Mon, Jun 17, 2024 at 03:51:35PM +0100, Szabolcs Nagy wrote: > > > to me it makes sense to have abstract > > > > > > PKEY_DISABLE_READ > > > PKEY_DISABLE_WRITE > > > PKEY_DISABLE_EXECUT

Re: [PATCH v4 17/29] arm64: implement PKEYS support

2024-07-16 Thread Anshuman Khandual
On 7/9/24 18:37, Kevin Brodsky wrote: > On 03/05/2024 15:01, Joey Gouly wrote: >> @@ -267,6 +294,28 @@ static inline unsigned long mm_untag_mask(struct >> mm_struct *mm) >> return -1UL >> 8; >> } >> >> +/* >> + * We only want to enforce protection keys on the current process >> + * beca

Re: [PATCH v4 17/29] arm64: implement PKEYS support

2024-07-11 Thread Joey Gouly
On Mon, Jul 08, 2024 at 06:53:18PM +0100, Catalin Marinas wrote: > Hi Szabolcs, > > On Mon, Jun 17, 2024 at 03:51:35PM +0100, Szabolcs Nagy wrote: > > The 06/17/2024 15:40, Florian Weimer wrote: > > > >> A user can still set it by interacting with the register directly, but > > > >> I guess > > >

Re: [PATCH v4 17/29] arm64: implement PKEYS support

2024-07-09 Thread Kevin Brodsky
On 03/05/2024 15:01, Joey Gouly wrote: > @@ -267,6 +294,28 @@ static inline unsigned long mm_untag_mask(struct > mm_struct *mm) > return -1UL >> 8; > } > > +/* > + * We only want to enforce protection keys on the current process > + * because we effectively have no access to POR_EL0 for o

Re: [PATCH v4 17/29] arm64: implement PKEYS support

2024-07-09 Thread Florian Weimer
* Szabolcs Nagy: >> However, does it matter much? That's only for the initial setup, the >> user can then change the permissions directly via the sysreg. So maybe >> we don't need all those combinations upfront. A PKEY_DISABLE_EXECUTE >> together with the full PKEY_DISABLE_ACCESS would probably su

Re: [PATCH v4 17/29] arm64: implement PKEYS support

2024-07-09 Thread Szabolcs Nagy
The 07/08/2024 18:53, Catalin Marinas wrote: > Hi Szabolcs, > > On Mon, Jun 17, 2024 at 03:51:35PM +0100, Szabolcs Nagy wrote: > > The 06/17/2024 15:40, Florian Weimer wrote: > > > >> A user can still set it by interacting with the register directly, but > > > >> I guess > > > >> we want somethin

Re: [PATCH v4 17/29] arm64: implement PKEYS support

2024-07-08 Thread Catalin Marinas
Hi Szabolcs, On Mon, Jun 17, 2024 at 03:51:35PM +0100, Szabolcs Nagy wrote: > The 06/17/2024 15:40, Florian Weimer wrote: > > >> A user can still set it by interacting with the register directly, but I > > >> guess > > >> we want something for the glibc interface.. > > >> > > >> Dave, any though

Re: [PATCH v4 17/29] arm64: implement PKEYS support

2024-07-05 Thread Catalin Marinas
On Fri, May 03, 2024 at 02:01:35PM +0100, Joey Gouly wrote: > @@ -163,7 +182,8 @@ static inline pteval_t __phys_to_pte_val(phys_addr_t phys) > #define pte_access_permitted_no_overlay(pte, write) \ > (((pte_val(pte) & (PTE_VALID | PTE_USER)) == (PTE_VALID | PTE_USER)) && > (!(write) || pte_w

Re: [PATCH v4 17/29] arm64: implement PKEYS support

2024-06-17 Thread Szabolcs Nagy
The 06/17/2024 15:40, Florian Weimer wrote: > >> A user can still set it by interacting with the register directly, but I > >> guess > >> we want something for the glibc interface.. > >> > >> Dave, any thoughts here? > > > > adding Florian too, since i found an old thread of his that tried > > to

Re: [PATCH v4 17/29] arm64: implement PKEYS support

2024-06-17 Thread Florian Weimer
* Szabolcs Nagy: >> A user can still set it by interacting with the register directly, but I >> guess >> we want something for the glibc interface.. >> >> Dave, any thoughts here? > > adding Florian too, since i found an old thread of his that tried > to add separate PKEY_DISABLE_READ and PKEY_D

Re: [PATCH v4 17/29] arm64: implement PKEYS support

2024-05-31 Thread Szabolcs Nagy
The 05/31/2024 16:21, Joey Gouly wrote: > Hi Szabolcs, > > On Fri, May 31, 2024 at 03:57:07PM +0100, Szabolcs Nagy wrote: > > The 05/03/2024 14:01, Joey Gouly wrote: > > > Implement the PKEYS interface, using the Permission Overlay Extension. > > ... > > > +#ifdef CONFIG_ARCH_HAS_PKEYS > > > +int

Re: [PATCH v4 17/29] arm64: implement PKEYS support

2024-05-31 Thread Joey Gouly
Hi Szabolcs, On Fri, May 31, 2024 at 03:57:07PM +0100, Szabolcs Nagy wrote: > The 05/03/2024 14:01, Joey Gouly wrote: > > Implement the PKEYS interface, using the Permission Overlay Extension. > ... > > +#ifdef CONFIG_ARCH_HAS_PKEYS > > +int arch_set_user_pkey_access(struct task_struct *tsk, int p

Re: [PATCH v4 17/29] arm64: implement PKEYS support

2024-05-31 Thread Szabolcs Nagy
The 05/03/2024 14:01, Joey Gouly wrote: > Implement the PKEYS interface, using the Permission Overlay Extension. ... > +#ifdef CONFIG_ARCH_HAS_PKEYS > +int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, unsigned > long init_val) > +{ > + u64 new_por = POE_RXW; > + u64 old_por

Re: [PATCH v4 17/29] arm64: implement PKEYS support

2024-05-30 Thread Amit Daniel Kachhap
On 5/3/24 18:31, Joey Gouly wrote: Implement the PKEYS interface, using the Permission Overlay Extension. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon --- arch/arm64/include/asm/mmu.h | 1 + arch/arm64/include/asm/mmu_context.h | 51 - arch/arm64

Re: [PATCH v4 17/29] arm64: implement PKEYS support

2024-05-28 Thread Joey Gouly
Hi Amit, Thanks for taking a look! On Tue, May 28, 2024 at 12:25:58PM +0530, Amit Daniel Kachhap wrote: > > > On 5/3/24 18:31, Joey Gouly wrote: > > Implement the PKEYS interface, using the Permission Overlay Extension. > > > > Signed-off-by: Joey Gouly > > Cc: Catalin Marinas > > Cc: Will D

[PATCH v4 17/29] arm64: implement PKEYS support

2024-05-03 Thread Joey Gouly
Implement the PKEYS interface, using the Permission Overlay Extension. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon --- arch/arm64/include/asm/mmu.h | 1 + arch/arm64/include/asm/mmu_context.h | 51 - arch/arm64/include/asm/pgtable.h | 22 +- ar