Re: host unresponsive when setting time very far in the future

From: Alan Somers <asomers_at_freebsd.org>
Date: Mon, 17 Oct 2022 13:08:16 UTC
On Mon, Oct 17, 2022 at 12:03 AM Michael Schuster
<michaelsprivate@gmail.com> wrote:
>
> to answer myself:
>
> On Mon, Oct 17, 2022 at 6:35 AM Michael Schuster
> <michaelsprivate@gmail.com> wrote:
> >
> > Jan,
> >
> > On Mon, Oct 17, 2022, 04:10 Jan Schaumann <jschauma@netmeister.org> wrote:
> >>
> >> Hello,
> >>
> >> I've observed that trying to set the date _very_ far
> >> in the future causes my FreeBSD AWS instance to become
> >> unresponsive and requiring a forced reboot to come
> >> back.  (I don't see an actual kernel panic, however.)
> >
> >
> > A few questions that come to mind:
> > - Which version of FreeBSD?
> > - which architecture (I know nothing of AWS, perhaps that's implied)?
> > - have you tried this on a different platform (a VM or real HW)?
>
> on AMD-based HW from 2020, running 13.1-RELEASE-p2, I could not
> duplicate OP's observation.

On 14.0-CURRENT there is a panic if you try to set past the year 10000
AD.  The commit message suggests that limitation is intended to
prevent overflows when the time gets converted into BCD, using a
16-bit year.  And other code suggests it's a limitation that can't be
easily lifted, because it's baked into the RTC hardware (for at least
some RTC chips, anyway).  But still, the panic ought to be converted
into an EINVAL.  The panics are in clock_ts_to_ct .

-Alan