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

From: Konstantin Belousov <kostikbel_at_gmail.com>
Date: Wed, 8 Jul 2015 13:21:37 +0300
On Wed, Jul 08, 2015 at 11:53:39AM +0200, Oliver Pinter 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.
Current implemention detail is that gettimeofday(-1) causes SIGSEGV
if kern.timecounter.hardware=TSC-low and kern.timecounter.fast_gettime=1.
If you timecounter changed for whatever reason, the result of that
call would fluctuate between EFAULT and signal.

This is not the only test in the test set which checks something that
cannot be reasonably explained.

> 
> >
> > (IMO the man page and test should change..)
> >
> > --
> > Daniel O'Connor
> > "The nice thing about standards is that there
> > are so many of them to choose from."
> >  -- Andrew Tanenbaum
> > GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
> >
> >
> _______________________________________________
> freebsd-current_at_freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_freebsd.org"
Received on Wed Jul 08 2015 - 08:21:58 UTC

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