From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rich Felker Subject: Re: The time(2) man page conflicts with glibc Date: Wed, 16 Dec 2015 02:08:39 -0500 Message-ID: <20151216070839.GE238@brightrain.aerifal.cx> References: <20151215145517.GR11489@vapier.lan> <20151215183826.GY11489@vapier.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Content-Disposition: inline In-Reply-To: <20151215183826.GY11489@vapier.lan> To: Zack Weinberg , "H.J. Lu" , "Michael Kerrisk (man-pages)" , libc-alpha , linux-man List-Id: linux-man@vger.kernel.org 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. Rich