Re: gettimeofday((void *)-1, NULL) implicates core dump on recent FreeBSD 11-CURRENT

From: Garrett Cooper <yaneurabeya_at_gmail.com>
Date: Wed, 8 Jul 2015 03:04:58 -0700
On Jul 8, 2015, at 2:53, Oliver Pinter <oliver.pinter_at_hardenedbsd.org> wrote:

> On 7/8/15, O'Connor, Daniel <darius_at_dons.net.au> wrote:
>> 
>>> On 8 Jul 2015, at 08:11, Garrett Wollman <wollman_at_hergotha.csail.mit.edu>
>>> wrote:
>>> Perhaps the test was (erroneously) written to assume that
>>> gettimeofday() was a system call, and could therefore detect invalid
>>> pointers and return [EFAULT].  This has not been the case for some
>>> time.  (In HEAD, not since r237434, which is three years ago.)
>> 
>> In defence of the test, the man page says it can return EFAULT.
> 
> That's fine, but why changed the behaviour since 2015. May 27.? I have
> an older FreeBSD/HardenedBSD install, where this test passing. See
> some previous email in this thread.

Hmm… works for me at least (no non-upstreamed changes to the kernel/userland as far as I remember — just more tests and some related build stuff).
Cheers,
-NGie

$ uname -a
FreeBSD fuji-current-amd64.local 11.0-CURRENT FreeBSD 11.0-CURRENT #1 r284769+70563d6(isilon-atf)-dirty: Thu Jul  2 13:19:45 PDT 2015     ngie_at_fuji-current-amd64.local:/usr/obj/usr/src/sys/FUJI  amd64
$ cc -Wall -g -O0 -o busted_gettimeofday busted_gettimeofday.c
$ ./busted_gettimeofday
busted_gettimeofday: gettimeofday: Bad address
$ cc -Wall -g -o busted_gettimeofday busted_gettimeofday.c
$ ./busted_gettimeofday
busted_gettimeofday: gettimeofday: Bad address
$ cc -Wall -o busted_gettimeofday busted_gettimeofday.c
$ ./busted_gettimeofday
busted_gettimeofday: gettimeofday: Bad address

Received on Wed Jul 08 2015 - 08:04:59 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:58 UTC