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

Garrett Cooper yaneurabeya at gmail.com
Wed Jul 8 10:04:59 UTC 2015


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 496 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/freebsd-current/attachments/20150708/48ea1375/attachment.bin>


More information about the freebsd-current mailing list