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 17:44:32 -0500 Message-ID: <20151216224432.GK238@brightrain.aerifal.cx> References: <20151215145517.GR11489@vapier.lan> <20151215183826.GY11489@vapier.lan> <20151216070839.GE238@brightrain.aerifal.cx> <20151216203432.GR11489@vapier.lan> <20151216215955.GJ238@brightrain.aerifal.cx> 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: To: Zack Weinberg Cc: "H.J. Lu" , "Michael Kerrisk (man-pages)" , libc-alpha , linux-man List-Id: linux-man@vger.kernel.org On Wed, Dec 16, 2015 at 05:27:03PM -0500, Zack Weinberg wrote: > On Wed, Dec 16, 2015 at 4:59 PM, Rich Felker wrote: > >> > 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. > > .... Do you consider the vDSO to be part of the kernel, or part of the C library? The vdso is library code provided by the kernel, but there's no fundamental reason to expect it to behave identically to the system call. Applications making the system call themselves directly will never end up calling the vdso code, so it doesn't matter if its behavior in corner cases like this is the same as the syscall. Said differently, the vdso function is a _new_ stable kernel API that's functionally similar to the syscall, not the same API, since you call it in a very different way. Rich