lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrX4psEHsCuJFjPGjeoA29LA4EOp9t+A3t2uH=wPQRXjaw@mail.gmail.com>
Date:	Tue, 8 Mar 2016 10:29:56 -0800
From:	Andy Lutomirski <luto@...capital.net>
To:	Ingo Molnar <mingo@...nel.org>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	Borislav Petkov <bp@...en8.de>, X86 ML <x86@...nel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Oleg Nesterov <oleg@...hat.com>,
	Andrew Cooper <andrew.cooper3@...rix.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Brian Gerst <brgerst@...il.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"H. Peter Anvin" <hpa@...or.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH] x86/entry: Improve system call entry comments

On Mar 8, 2016 2:27 AM, "Ingo Molnar" <mingo@...nel.org> wrote:
>
>
> * Andy Lutomirski <luto@...capital.net> wrote:
>
> > > >  ENTRY(entry_INT80_32)
> > >
> > > entry_INT80_32() is only used on pure 32-bit kernels, 64-bit kernels use
> > > entry_INT80_compat(). So the above text should not talk about 64-bit programs, as
> > > they can never trigger this specific entry point, right?
> > >
> >
> > 64-bit programs can and sometimes do trigger this entry point. [...]
>
> How can 64-bit programs trigger entry_INT80_32? It's only ever set on 32-bit
> kernels:
>
> #ifdef CONFIG_X86_32
>         set_system_trap_gate(IA32_SYSCALL_VECTOR, entry_INT80_32);
>         set_bit(IA32_SYSCALL_VECTOR, used_vectors);
> #endif
>
> > [...]  It does a 32-bit syscall regardless of the caller's bitness, but it
> > returns back to the caller's original context, whatever it was.
>
> That's true of INT $0x80, but I'm talking about the entry point: AFAICS
> entry_INT80_32 can only ever execute on 32-bit kernels.

Oh, duh.

>
> We don't even build the entry_32.S::entry_INT80_32 entry point on 64-bit kernels:
>
> obj-y                           := entry_$(BITS).o [...]
>
> >
> > > So I'd change the explanation to something like:
> > >
> > > > + * This entry point is active on 32-bit kernels and can thus be used by 32-bit
> > > > + * programs to perform 32-bit system calls. (Programs running on 64-bit
> > > > + * kernels executing INT $0x80 will land on another entry point:
> > > > + * entry_INT80_compat. The ABI is identical.)
> >
> > I like the part in parentheses.
>
> So the part in parentheses conflict with your above statement :)
>
> What I wanted to say with this:
>
> > > > + * This entry point is active on 32-bit kernels and can thus be used by 32-bit
> > > > + * programs to perform 32-bit system calls. (Programs running on 64-bit
> > > > + * kernels executing INT $0x80 will land on another entry point:
> > > > + * entry_INT80_compat. The ABI is identical.)
>
> ... is what it says: that entry_INT80_32 is only active on 32-bit kernels, running
> 32-bit programs, performing 32-bit system calls.
>
> Programs running on 64-bit kernels can use INT $0x80 as well, but will land on
> another, different, 64-bit kernel specific entry point.
>
> What am I missing?
>

Nothing.  I mis-read your earlier email.  Want to fix and apply it, or
should I send a new version?

> Thanks,
>
>         Ingo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ