The time(2) man page conflicts with glibc
Mike Frysinger
vapier@gentoo.org
Thu Dec 17 03:15:00 GMT 2015
On 16 Dec 2015 16:59, Rich Felker wrote:
> On Wed, Dec 16, 2015 at 03:34:32PM -0500, Mike Frysinger wrote:
> > On 16 Dec 2015 02:08, Rich Felker wrote:
> > > On Tue, Dec 15, 2015 at 01:38:26PM -0500, Mike Frysinger wrote:
> > > > On 15 Dec 2015 10:19, Zack Weinberg wrote:
> > > > > On Tue, Dec 15, 2015 at 9:55 AM, Mike Frysinger wrote:
> > > > > > On 15 Dec 2015 09:14, Zack Weinberg wrote:
> > > > > >> Given the extreme obsolescence of the argument to `time`, I would
> > > > > >> recommend that the *kernel* be changed to fire an actual SIGSEGV
> > > > > >> instead of returning -EFAULT from the syscall version of `time`, and
> > > > > >> then that can be the documented behavior, with the historic behavior
> > > > > >> relegated to the BUGS section of the manpage.
> > > > > >
> > > > > > meh. it would be out of character for the kernel to do this.
> > > > >
> > > > > Why?
> > > >
> > > > because it returns EFAULT for other syscalls when you pass bad pointers.
> > > > projects like LTP utilize that to verify edge case functionality.
> > >
> > > Programs could also be calling the syscall directly (using syscall()
> > > or asm) and using it as a (very cheap, fail-safe) way to verify that
> > > an address is writable before attempting to write to it. Breaking this
> > > would be a kernel API regression. However the library function time()
> > > has UB for invalid pointers and no obligation to support them.
> >
> > sure, but that still doesn't mean the kernel should be sending SEGV.
> > which is what this subthread was about.
>
> The kernel is not causing SIGSEGV as far as I can tell; it's purely
> the library function time that's causing this.
i'm fully aware of that. please see the context in this subthread.
i've already trimmed all unrelated content.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20151217/7123a8d0/attachment.sig>
More information about the Libc-alpha
mailing list