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: <CALCETrVo42mw6xd8an0F37A+cx-vPje0Xmgh0-coG7N1J7a8kA@mail.gmail.com>
Date:	Mon, 7 Mar 2016 09:01:50 -0800
From:	Andy Lutomirski <luto@...capital.net>
To:	Ingo Molnar <mingo@...nel.org>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	Borislav Petkov <bp@...en8.de>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Andrew Cooper <andrew.cooper3@...rix.com>,
	Oleg Nesterov <oleg@...hat.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Brian Gerst <brgerst@...il.com>,
	"H. Peter Anvin" <hpa@...or.com>, X86 ML <x86@...nel.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH] x86/entry: Improve system call entry comments

On Mar 7, 2016 12:22 AM, "Ingo Molnar" <mingo@...nel.org> wrote:
>
>
> * Andy Lutomirski <luto@...nel.org> wrote:
>
> > Ingo suggested that the comments should explain when the various
> > entries are used.  This adds these explanations and improves other
> > parts of the comments.
>
> Thanks for doing this, this is really useful!
>
> One very small detail I noticed:
>
> > +/*
> > + * 32-bit legacy system call entry.
> > + *
> > + * 32-bit x86 Linux system calls traditionally used the INT $0x80
> > + * instruction.  INT $0x80 lands here.
> > + *
> > + * This entry point can be used by 32-bit and 64-bit programs to perform
> > + * 32-bit system calls.  Instances of INT $0x80 can be found inline in
> > + * various programs and libraries.  It is also used by the vDSO's
> > + * __kernel_vsyscall fallback for hardware that doesn't support a faster
> > + * entry method.  Restarted 32-bit system calls also fall back to INT
> > + * $0x80 regardless of what instruction was originally used to do the
> > + * system call.
> > + *
> > + * This is considered a slow path.  It is not used by modern libc
> > + * implementations on modern hardware except during process startup.
> > + *
> > + * Arguments:
> > + * eax  system call number
> > + * ebx  arg1
> > + * ecx  arg2
> > + * edx  arg3
> > + * esi  arg4
> > + * edi  arg5
> > + * ebp  arg6
> > + */
> >  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.  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.

> 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.

--Andy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ