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

Doug Rabson dfr at rabson.org
Wed Jul 8 19:18:02 UTC 2015


As far as I can tell, POSIX doesn't require either EFAULT or any other
behaviour - the text in http://www.open-std.org/jtc1/sc22/open/n4217.pdf
just says, "No errors are defined". Our man page is wrong and any real
program which relies on gettimeofday not faulting when given bad inputs is
broken.

On 8 July 2015 at 17:16, Jamie Landeg-Jones <jamie at dyslexicfish.net> wrote:

> Oliver Pinter <oliver.pinter at hardenedbsd.org> wrote:
>
> > On 7/8/15, O'Connor, Daniel <darius at dons.net.au> wrote:
> > >
> > > 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.
>
> That's why it's called 'undefined' :-)
>
> Pedantically, being 'undefined', it's behaviour hasn't changed at all!
> _______________________________________________
> 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"
>


More information about the freebsd-current mailing list