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: <4E607506.8030708@mit.edu>
Date:	Fri, 02 Sep 2011 02:17:42 -0400
From:	Andy Lutomirski <luto@....EDU>
To:	"H. Peter Anvin" <hpa@...or.com>
CC:	Linus Torvalds <torvalds@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>,
	"H.J. Lu" <hjl.tools@...il.com>, Ingo Molnar <mingo@...e.hu>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: Re: RFD: x32 ABI system call numbers

On 08/26/2011 07:39 PM, H. Peter Anvin wrote:
> On 08/26/2011 04:13 PM, Linus Torvalds wrote:
>>>
>>> The extra bit would be masked off and only affect device drivers like
>>> input which relies on is_compat().
>>
>> So a couple of questions:
>>
>>   - why do we need another system call model at all?
>
> We think we can get more performance for a process which doesn't need
> more than 4 GiB of virtual address space by allowing them to keep
> pointers 4 bytes long, while still giving them the advantage of 16
> 64-bit registers, PC-relative addressing, and so on.  Furthermore, there
> are users who seem more willing to port code known to not be 64-bit
> clean to x32 than to do a whole new port.
>
> If the question is "why not just thunk this in userspace", the answer is
> that we'd like to take advantage of the compat layer already in the kernel.
>
> If the question is "why not just use int $0x80" we actually did that in
> early prototyping, but SYSCALL64 is much faster.

This may be a dumb question, but:

Why not just set some high bit of rax to enable compat syscalls to be 
issued with the 64-bit SYSCALL instruction.  This could be done with 
zero overhead for normal 64-bit code (you can just adjust the existing 
system-call-number-too-high path) and the total kernel patch should be 
just a handful of lines.  Does x32 need any more kernel support than 
that?  You'll confuse strace on new binaries, but that shouldn't be a 
big deal.

Also, why do ioctls and userspace structs need any translation at all? 
This is a new ABI -- why not just teach x32 code to stick zeros in its 
structs in the appropriate places to use the 64-bit layout.

--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ