Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-02 Thread Thomas Gleixner
On Thu, 2 Nov 2017, Linus Torvalds wrote: > On Thu, Nov 2, 2017 at 11:40 AM, Thomas Gleixner wrote: > > > > Hmm. Not sure. IIRC you need to be able to read it to figure out where the > > entry points are. They are at fixed offsets, but there is some voodoo out > > there

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-02 Thread Thomas Gleixner
On Thu, 2 Nov 2017, Linus Torvalds wrote: > On Thu, Nov 2, 2017 at 11:40 AM, Thomas Gleixner wrote: > > > > Hmm. Not sure. IIRC you need to be able to read it to figure out where the > > entry points are. They are at fixed offsets, but there is some voodoo out > > there which reads the 'elf' to

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-02 Thread Linus Torvalds
On Thu, Nov 2, 2017 at 11:40 AM, Thomas Gleixner wrote: > > Hmm. Not sure. IIRC you need to be able to read it to figure out where the > entry points are. They are at fixed offsets, but there is some voodoo out > there which reads the 'elf' to get to them. That would actually

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-02 Thread Linus Torvalds
On Thu, Nov 2, 2017 at 11:40 AM, Thomas Gleixner wrote: > > Hmm. Not sure. IIRC you need to be able to read it to figure out where the > entry points are. They are at fixed offsets, but there is some voodoo out > there which reads the 'elf' to get to them. That would actually be really painful.

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-02 Thread Thomas Gleixner
On Thu, 2 Nov 2017, Linus Torvalds wrote: > On Thu, Nov 2, 2017 at 11:19 AM, Andy Lutomirski wrote: > > > > We'd have to force NONE, and Linus won't like it. > > Oh, I think it's fine for the kaiser case. > > I am not convinced anybody will actually use it, but if you do

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-02 Thread Thomas Gleixner
On Thu, 2 Nov 2017, Linus Torvalds wrote: > On Thu, Nov 2, 2017 at 11:19 AM, Andy Lutomirski wrote: > > > > We'd have to force NONE, and Linus won't like it. > > Oh, I think it's fine for the kaiser case. > > I am not convinced anybody will actually use it, but if you do use it, > I suspect

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-02 Thread Thomas Gleixner
On Thu, 2 Nov 2017, Andy Lutomirski wrote: > > On Nov 2, 2017, at 5:38 PM, Dave Hansen wrote: > > > >> On 11/02/2017 04:33 AM, Thomas Gleixner wrote: > >> So for the problem at hand, I'd suggest we disable the vsyscall stuff if > >> CONFIG_KAISER=y and be done with

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-02 Thread Linus Torvalds
On Thu, Nov 2, 2017 at 11:19 AM, Andy Lutomirski wrote: > > We'd have to force NONE, and Linus won't like it. Oh, I think it's fine for the kaiser case. I am not convinced anybody will actually use it, but if you do use it, I suspect "the legacy vsyscall page no longer

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-02 Thread Thomas Gleixner
On Thu, 2 Nov 2017, Andy Lutomirski wrote: > > On Nov 2, 2017, at 5:38 PM, Dave Hansen wrote: > > > >> On 11/02/2017 04:33 AM, Thomas Gleixner wrote: > >> So for the problem at hand, I'd suggest we disable the vsyscall stuff if > >> CONFIG_KAISER=y and be done with it. > > > > Just to be

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-02 Thread Linus Torvalds
On Thu, Nov 2, 2017 at 11:19 AM, Andy Lutomirski wrote: > > We'd have to force NONE, and Linus won't like it. Oh, I think it's fine for the kaiser case. I am not convinced anybody will actually use it, but if you do use it, I suspect "the legacy vsyscall page no longer works" is the least of

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-02 Thread Andy Lutomirski
> On Nov 2, 2017, at 5:38 PM, Dave Hansen wrote: > >> On 11/02/2017 04:33 AM, Thomas Gleixner wrote: >> So for the problem at hand, I'd suggest we disable the vsyscall stuff if >> CONFIG_KAISER=y and be done with it. > > Just to be clear, are we suggesting to just

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-02 Thread Andy Lutomirski
> On Nov 2, 2017, at 5:38 PM, Dave Hansen wrote: > >> On 11/02/2017 04:33 AM, Thomas Gleixner wrote: >> So for the problem at hand, I'd suggest we disable the vsyscall stuff if >> CONFIG_KAISER=y and be done with it. > > Just to be clear, are we suggesting to just disable >

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-02 Thread Dave Hansen
On 11/02/2017 04:33 AM, Thomas Gleixner wrote: > So for the problem at hand, I'd suggest we disable the vsyscall stuff if > CONFIG_KAISER=y and be done with it. Just to be clear, are we suggesting to just disable LEGACY_VSYSCALL_NATIVE if KAISER=y, and allow LEGACY_VSYSCALL_EMULATE? Or, do we

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-02 Thread Dave Hansen
On 11/02/2017 04:33 AM, Thomas Gleixner wrote: > So for the problem at hand, I'd suggest we disable the vsyscall stuff if > CONFIG_KAISER=y and be done with it. Just to be clear, are we suggesting to just disable LEGACY_VSYSCALL_NATIVE if KAISER=y, and allow LEGACY_VSYSCALL_EMULATE? Or, do we

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-02 Thread Thomas Gleixner
On Thu, 2 Nov 2017, Andy Lutomirski wrote: > > On Nov 2, 2017, at 12:33 PM, Thomas Gleixner wrote: > > Fair enough. I enabled function tracing with emulate_vsyscall as the filter > > on a couple of machines and so far I have no hit at all. Though I found a > > VM with a real

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-02 Thread Thomas Gleixner
On Thu, 2 Nov 2017, Andy Lutomirski wrote: > > On Nov 2, 2017, at 12:33 PM, Thomas Gleixner wrote: > > Fair enough. I enabled function tracing with emulate_vsyscall as the filter > > on a couple of machines and so far I have no hit at all. Though I found a > > VM with a real old user space

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-02 Thread Andy Lutomirski
> On Nov 2, 2017, at 12:33 PM, Thomas Gleixner wrote: > >> On Thu, 2 Nov 2017, Andy Lutomirski wrote: >>> On Wed, Nov 1, 2017 at 3:20 PM, Thomas Gleixner wrote: On Wed, 1 Nov 2017, Linus Torvalds wrote: > On Wed, Nov 1, 2017 at 2:52 PM, Dave

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-02 Thread Andy Lutomirski
> On Nov 2, 2017, at 12:33 PM, Thomas Gleixner wrote: > >> On Thu, 2 Nov 2017, Andy Lutomirski wrote: >>> On Wed, Nov 1, 2017 at 3:20 PM, Thomas Gleixner wrote: On Wed, 1 Nov 2017, Linus Torvalds wrote: > On Wed, Nov 1, 2017 at 2:52 PM, Dave Hansen > wrote: >> On 11/01/2017

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-02 Thread Thomas Gleixner
On Thu, 2 Nov 2017, Andy Lutomirski wrote: > On Wed, Nov 1, 2017 at 3:20 PM, Thomas Gleixner wrote: > > On Wed, 1 Nov 2017, Linus Torvalds wrote: > >> On Wed, Nov 1, 2017 at 2:52 PM, Dave Hansen > >> wrote: > >> > On 11/01/2017 02:28 PM, Thomas

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-02 Thread Thomas Gleixner
On Thu, 2 Nov 2017, Andy Lutomirski wrote: > On Wed, Nov 1, 2017 at 3:20 PM, Thomas Gleixner wrote: > > On Wed, 1 Nov 2017, Linus Torvalds wrote: > >> On Wed, Nov 1, 2017 at 2:52 PM, Dave Hansen > >> wrote: > >> > On 11/01/2017 02:28 PM, Thomas Gleixner wrote: > >> >> On Wed, 1 Nov 2017, Andy

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-02 Thread Thomas Gleixner
On Thu, 2 Nov 2017, Andy Lutomirski wrote: > On Wed, Nov 1, 2017 at 2:28 PM, Thomas Gleixner wrote: > > On Wed, 1 Nov 2017, Andy Lutomirski wrote: > > > >> On Wed, Nov 1, 2017 at 2:11 PM, Thomas Gleixner wrote: > >> > On Tue, 31 Oct 2017, Dave Hansen

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-02 Thread Thomas Gleixner
On Thu, 2 Nov 2017, Andy Lutomirski wrote: > On Wed, Nov 1, 2017 at 2:28 PM, Thomas Gleixner wrote: > > On Wed, 1 Nov 2017, Andy Lutomirski wrote: > > > >> On Wed, Nov 1, 2017 at 2:11 PM, Thomas Gleixner wrote: > >> > On Tue, 31 Oct 2017, Dave Hansen wrote: > >> > > >> >> > >> >> init_mm is for

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-02 Thread Andy Lutomirski
On Wed, Nov 1, 2017 at 3:20 PM, Thomas Gleixner wrote: > On Wed, 1 Nov 2017, Linus Torvalds wrote: >> On Wed, Nov 1, 2017 at 2:52 PM, Dave Hansen >> wrote: >> > On 11/01/2017 02:28 PM, Thomas Gleixner wrote: >> >> On Wed, 1 Nov 2017, Andy

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-02 Thread Andy Lutomirski
On Wed, Nov 1, 2017 at 3:20 PM, Thomas Gleixner wrote: > On Wed, 1 Nov 2017, Linus Torvalds wrote: >> On Wed, Nov 1, 2017 at 2:52 PM, Dave Hansen >> wrote: >> > On 11/01/2017 02:28 PM, Thomas Gleixner wrote: >> >> On Wed, 1 Nov 2017, Andy Lutomirski wrote: >> >>> The vsyscall page is _PAGE_USER

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-02 Thread Andy Lutomirski
On Wed, Nov 1, 2017 at 2:28 PM, Thomas Gleixner wrote: > On Wed, 1 Nov 2017, Andy Lutomirski wrote: > >> On Wed, Nov 1, 2017 at 2:11 PM, Thomas Gleixner wrote: >> > On Tue, 31 Oct 2017, Dave Hansen wrote: >> > >> >> >> >> init_mm is for kernel-exclusive

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-02 Thread Andy Lutomirski
On Wed, Nov 1, 2017 at 2:28 PM, Thomas Gleixner wrote: > On Wed, 1 Nov 2017, Andy Lutomirski wrote: > >> On Wed, Nov 1, 2017 at 2:11 PM, Thomas Gleixner wrote: >> > On Tue, 31 Oct 2017, Dave Hansen wrote: >> > >> >> >> >> init_mm is for kernel-exclusive use. If someone is allocating page >> >>

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-01 Thread Kees Cook
On Wed, Nov 1, 2017 at 3:20 PM, Thomas Gleixner wrote: > On Wed, 1 Nov 2017, Linus Torvalds wrote: >> On Wed, Nov 1, 2017 at 2:52 PM, Dave Hansen >> wrote: >> > On 11/01/2017 02:28 PM, Thomas Gleixner wrote: >> >> On Wed, 1 Nov 2017, Andy

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-01 Thread Kees Cook
On Wed, Nov 1, 2017 at 3:20 PM, Thomas Gleixner wrote: > On Wed, 1 Nov 2017, Linus Torvalds wrote: >> On Wed, Nov 1, 2017 at 2:52 PM, Dave Hansen >> wrote: >> > On 11/01/2017 02:28 PM, Thomas Gleixner wrote: >> >> On Wed, 1 Nov 2017, Andy Lutomirski wrote: >> >>> The vsyscall page is _PAGE_USER

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-01 Thread Thomas Gleixner
On Wed, 1 Nov 2017, Linus Torvalds wrote: > On Wed, Nov 1, 2017 at 2:52 PM, Dave Hansen > wrote: > > On 11/01/2017 02:28 PM, Thomas Gleixner wrote: > >> On Wed, 1 Nov 2017, Andy Lutomirski wrote: > >>> The vsyscall page is _PAGE_USER and lives in init_mm via the

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-01 Thread Thomas Gleixner
On Wed, 1 Nov 2017, Linus Torvalds wrote: > On Wed, Nov 1, 2017 at 2:52 PM, Dave Hansen > wrote: > > On 11/01/2017 02:28 PM, Thomas Gleixner wrote: > >> On Wed, 1 Nov 2017, Andy Lutomirski wrote: > >>> The vsyscall page is _PAGE_USER and lives in init_mm via the fixmap. > >> > >> Groan, forgot

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-01 Thread Linus Torvalds
On Wed, Nov 1, 2017 at 2:52 PM, Dave Hansen wrote: > On 11/01/2017 02:28 PM, Thomas Gleixner wrote: >> On Wed, 1 Nov 2017, Andy Lutomirski wrote: >>> The vsyscall page is _PAGE_USER and lives in init_mm via the fixmap. >> >> Groan, forgot about that abomination, but

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-01 Thread Linus Torvalds
On Wed, Nov 1, 2017 at 2:52 PM, Dave Hansen wrote: > On 11/01/2017 02:28 PM, Thomas Gleixner wrote: >> On Wed, 1 Nov 2017, Andy Lutomirski wrote: >>> The vsyscall page is _PAGE_USER and lives in init_mm via the fixmap. >> >> Groan, forgot about that abomination, but still there is no point in

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-01 Thread Thomas Gleixner
On Wed, 1 Nov 2017, Dave Hansen wrote: > On 11/01/2017 02:28 PM, Thomas Gleixner wrote: > > On Wed, 1 Nov 2017, Andy Lutomirski wrote: > >> The vsyscall page is _PAGE_USER and lives in init_mm via the fixmap. > > > > Groan, forgot about that abomination, but still there is no point in having > >

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-01 Thread Thomas Gleixner
On Wed, 1 Nov 2017, Dave Hansen wrote: > On 11/01/2017 02:28 PM, Thomas Gleixner wrote: > > On Wed, 1 Nov 2017, Andy Lutomirski wrote: > >> The vsyscall page is _PAGE_USER and lives in init_mm via the fixmap. > > > > Groan, forgot about that abomination, but still there is no point in having > >

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-01 Thread Dave Hansen
On 11/01/2017 02:28 PM, Thomas Gleixner wrote: > On Wed, 1 Nov 2017, Andy Lutomirski wrote: >> The vsyscall page is _PAGE_USER and lives in init_mm via the fixmap. > > Groan, forgot about that abomination, but still there is no point in having > it marked PAGE_USER in the init_mm at all, kaiser

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-01 Thread Dave Hansen
On 11/01/2017 02:28 PM, Thomas Gleixner wrote: > On Wed, 1 Nov 2017, Andy Lutomirski wrote: >> The vsyscall page is _PAGE_USER and lives in init_mm via the fixmap. > > Groan, forgot about that abomination, but still there is no point in having > it marked PAGE_USER in the init_mm at all, kaiser

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-01 Thread Thomas Gleixner
On Wed, 1 Nov 2017, Andy Lutomirski wrote: > On Wed, Nov 1, 2017 at 2:11 PM, Thomas Gleixner wrote: > > On Tue, 31 Oct 2017, Dave Hansen wrote: > > > >> > >> init_mm is for kernel-exclusive use. If someone is allocating page > >> tables in it, do not set _PAGE_USER on them.

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-01 Thread Thomas Gleixner
On Wed, 1 Nov 2017, Andy Lutomirski wrote: > On Wed, Nov 1, 2017 at 2:11 PM, Thomas Gleixner wrote: > > On Tue, 31 Oct 2017, Dave Hansen wrote: > > > >> > >> init_mm is for kernel-exclusive use. If someone is allocating page > >> tables in it, do not set _PAGE_USER on them. This ensures that >

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-01 Thread Andy Lutomirski
On Wed, Nov 1, 2017 at 2:11 PM, Thomas Gleixner wrote: > On Tue, 31 Oct 2017, Dave Hansen wrote: > >> >> init_mm is for kernel-exclusive use. If someone is allocating page >> tables in it, do not set _PAGE_USER on them. This ensures that >> we do *not* set NX on these page

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-01 Thread Andy Lutomirski
On Wed, Nov 1, 2017 at 2:11 PM, Thomas Gleixner wrote: > On Tue, 31 Oct 2017, Dave Hansen wrote: > >> >> init_mm is for kernel-exclusive use. If someone is allocating page >> tables in it, do not set _PAGE_USER on them. This ensures that >> we do *not* set NX on these page tables in the KAISER

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-01 Thread Thomas Gleixner
On Tue, 31 Oct 2017, Dave Hansen wrote: > > init_mm is for kernel-exclusive use. If someone is allocating page > tables in it, do not set _PAGE_USER on them. This ensures that > we do *not* set NX on these page tables in the KAISER code. This changelog is confusing at best. Why is this a

Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-11-01 Thread Thomas Gleixner
On Tue, 31 Oct 2017, Dave Hansen wrote: > > init_mm is for kernel-exclusive use. If someone is allocating page > tables in it, do not set _PAGE_USER on them. This ensures that > we do *not* set NX on these page tables in the KAISER code. This changelog is confusing at best. Why is this a

[PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-10-31 Thread Dave Hansen
init_mm is for kernel-exclusive use. If someone is allocating page tables in it, do not set _PAGE_USER on them. This ensures that we do *not* set NX on these page tables in the KAISER code. Signed-off-by: Dave Hansen Cc: Moritz Lipp

[PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables

2017-10-31 Thread Dave Hansen
init_mm is for kernel-exclusive use. If someone is allocating page tables in it, do not set _PAGE_USER on them. This ensures that we do *not* set NX on these page tables in the KAISER code. Signed-off-by: Dave Hansen Cc: Moritz Lipp Cc: Daniel Gruss Cc: Michael Schwarz Cc: Andy Lutomirski