Re: [RFC PATCH] seccomp: Add protection keys into seccomp_data

2022-11-16 Thread Stephen Röttger
On Tue, Nov 15, 2022 at 5:16 AM Michael Sammler wrote: > > We're currently working on a feature in chromium that uses pkeys for > > in-process isolation. Being able to use the pkey state in the seccomp > > filter would be pretty useful for this. For example, it would allow > > us to enforce that n

Re: [RFC PATCH] seccomp: Add protection keys into seccomp_data

2022-11-14 Thread Michael Sammler
> We're currently working on a feature in chromium that uses pkeys for > in-process isolation. Being able to use the pkey state in the seccomp > filter would be pretty useful for this. For example, it would allow > us to enforce that no code outside the isolated thread would ever > map/mprotect

Re: [RFC PATCH] seccomp: Add protection keys into seccomp_data

2022-11-14 Thread Stephen Röttger
> Add the current value of an architecture specific protection keys > register (currently PKRU on x86) to data available for seccomp-bpf > programs to work on. This allows filters based on the currently > enabled protection keys. We're currently working on a feature in chromium that uses pkeys for

Re: [RFC PATCH] seccomp: Add protection keys into seccomp_data

2018-10-30 Thread Michael Sammler
On 10/29/2018 11:33 PM, Dave Hansen wrote: But, that's really an implementation detail. The effect on the ABI and how this might constrain future pkeys use is my bigger worry. I'd also want to make sure that your specific use-case is compatible with all the oddities of pkeys, like the 'clone' a

Re: [RFC PATCH] seccomp: Add protection keys into seccomp_data

2018-10-29 Thread Dave Hansen
On 10/29/18 2:55 PM, Michael Sammler wrote: >> PKRU getting reset on signals, and the requirement now that it *can't* >> be changed if you make syscalls probably needs to get thought about very >> carefully before we do this, though. > I am not sure, whether I follow you. Are you saying, that PKRU

Re: [RFC PATCH] seccomp: Add protection keys into seccomp_data

2018-10-29 Thread Michael Sammler
Am 29.10.2018 um 18:29 schrieb Dave Hansen: On 10/29/18 9:48 AM, Jann Horn wrote: On Mon, Oct 29, 2018 at 5:37 PM Dave Hansen wrote: I'm not sure this is a great use for PKRU. I *think* the basic problem is that you want to communicate some rights information down into a filter, and you want

Re: [RFC PATCH] seccomp: Add protection keys into seccomp_data

2018-10-29 Thread Dave Hansen
On 10/29/18 9:48 AM, Jann Horn wrote: > On Mon, Oct 29, 2018 at 5:37 PM Dave Hansen wrote: >> I'm not sure this is a great use for PKRU. I *think* the basic problem >> is that you want to communicate some rights information down into a >> filter, and you want to communicate it with PKRU. While i

Re: [RFC PATCH] seccomp: Add protection keys into seccomp_data

2018-10-29 Thread Dave Hansen
On 10/29/18 10:02 AM, Michael Sammler wrote: >>> Also, I'm not sure the kernel provides the PKRU guarantees you want at >>> the moment.  Our implementation *probably* works, but it's mostly by >>> accident. > I don't know, which guarantees about the PKRU are provided at the > moment, but the only g

Re: [RFC PATCH] seccomp: Add protection keys into seccomp_data

2018-10-29 Thread Michael Sammler
On 10/29/2018 05:48 PM, Ram Pai wrote: On Mon, Oct 29, 2018 at 09:25:15AM -0700, Kees Cook wrote: On Mon, Oct 29, 2018 at 4:23 AM, Michael Sammler wrote: Add the current value of an architecture specific protection keys register (currently PKRU on x86) to data available for seccomp-bpf progra

Re: [RFC PATCH] seccomp: Add protection keys into seccomp_data

2018-10-29 Thread Michael Sammler
On 10/29/2018 05:48 PM, Jann Horn wrote: On Mon, Oct 29, 2018 at 5:37 PM Dave Hansen wrote: On 10/29/18 9:25 AM, Kees Cook wrote: On Mon, Oct 29, 2018 at 4:23 AM, Michael Sammler wrote: Add the current value of an architecture specific protection keys register (currently PKRU on x86) to data

Re: [RFC PATCH] seccomp: Add protection keys into seccomp_data

2018-10-29 Thread Ram Pai
On Mon, Oct 29, 2018 at 09:25:15AM -0700, Kees Cook wrote: > On Mon, Oct 29, 2018 at 4:23 AM, Michael Sammler wrote: > > Add the current value of an architecture specific protection keys > > register (currently PKRU on x86) to data available for seccomp-bpf > > programs to work on. This allows fil

Re: [RFC PATCH] seccomp: Add protection keys into seccomp_data

2018-10-29 Thread Dave Hansen
On 10/29/18 9:25 AM, Kees Cook wrote: > On Mon, Oct 29, 2018 at 4:23 AM, Michael Sammler wrote: >> Add the current value of an architecture specific protection keys >> register (currently PKRU on x86) to data available for seccomp-bpf >> programs to work on. This allows filters based on the curren

Re: [RFC PATCH] seccomp: Add protection keys into seccomp_data

2018-10-29 Thread Kees Cook
On Mon, Oct 29, 2018 at 4:23 AM, Michael Sammler wrote: > Add the current value of an architecture specific protection keys > register (currently PKRU on x86) to data available for seccomp-bpf > programs to work on. This allows filters based on the currently > enabled protection keys. > > Support

[RFC PATCH] seccomp: Add protection keys into seccomp_data

2018-10-29 Thread Michael Sammler
Add the current value of an architecture specific protection keys register (currently PKRU on x86) to data available for seccomp-bpf programs to work on. This allows filters based on the currently enabled protection keys. Support for protection keys on the POWER architecture is not part of this pa