|
Message-ID: <20200121184950.GT30412@brightrain.aerifal.cx>
Date: Tue, 21 Jan 2020 13:49:50 -0500
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: [RFC] [PATCH] removing __NR_clock_gettime / SYS_clock_gettime
On Sun, Jan 19, 2020 at 11:36:16AM -0500, Rich Felker wrote:
> Today we discovered that libstdc++ std::chrono is broken because it's
> making direct syscalls to SYS_clock_gettime to work around glibc
> putting clock_gettime in librt. This is exactly the same issue as
> busybox https://bugs.busybox.net/show_bug.cgi?id=12091 and I would not
> be surprised if it exists in more software. It's a silent bug that's
> easy to find and fix if you know what to look for, but very confusing
> and hard to find if you don't, and it can easily slip into software
> that's not well-tested on time64.
>
> What I'd like to propose doing is removing __NR_clock_gettime and
> SYS_clock_gettime from the public sys/syscall.h (via bits headers) on
> 32-bit archs, and moving SYS_clock_gettime to
> arch/$(ARCH)/syscall_arch.h for musl-internal use. This would make it
> a hard compile-time error for any software attempting to use the
> syscall directly, and in the case of libstdc++ I think it would even
> fix the problem without patching gcc, since they have a configure
> check for the syscall.
>
> Thoughts? Is this too big a hammer?
Patch attached.
Rich
View attachment "remove_gtod32.diff" of type "text/plain" (7665 bytes)
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.