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: <CA+55aFxtM0MbqBYQoTxfPOj8jVqj1Rc=s3YjDhg5wXUb3Y5BPQ@mail.gmail.com>
Date:	Fri, 26 Aug 2011 18:18:04 -0700
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	"H. Peter Anvin" <hpa@...or.com>
Cc:	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 Fri, Aug 26, 2011 at 5:53 PM, H. Peter Anvin <hpa@...or.com> wrote:
>
> Unfortunately, there is actually a reason for the use of "unsigned long"
> here -- it means that the combination of the time and the _nsec fields
> matches struct timespec.  struct timespec/struct timeval is one of those
> things that it would be really nice if we *could* change (it's not
> inherently pointer-sized, and it really should be 64 bits), but struct
> timespec and struct timeval are embedded in a a number of memory
> structures, some of which have pointers; and they are used by ioctls.

But for "struct stat"? You can't depend on that anyway.

I do agree that it would be nice to just make "struct timeval" always
be 64 bits, and I actually think it *should* be done for any new ABI.
If for no other reason than "time_t" should be 64-bit, in order to
avoid all the issues with 2038.

Because the POSIX defintion of 'timeval' is *not* that the fields must
be 'long'. It's "time_t" + "suseconds_t", so it should be entirely
possible to make 'struct timeval' use 64-bit fields.

"struct timespec" seems to be designed as "time_t" + "long" which is
sad. But again, we could easily make it be

  typedef __u64 time_t;

  struct timespec {
    time_t tv_sec;
    long tv_nsec;
    long tv_unused;
  }

and it would actually be perfectly compatible with x86-64.

And I really do think that a new 32-bit ABI is *much* better off
trying to be compatible with x86-64 (and avoiding things like 2038)
than it is trying to be compatible with the old-style x86-32 binaries.
I realize that it may be *easier* to be compatible with x86-32 and
just add a few new system calls, but I think it's wrong.

2038 is a long time away for legacy binaries. It's *not* all that long
away if you are introducing a new 32-bit mode for performance.

                       Linus

But I think that's independent of 'struct stat' anyway.
--
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