[BusyBox] Serious bug in udhcpc
Steven Scholz
steven.scholz at imc-berlin.de
Tue Apr 22 08:27:34 UTC 2003
Wolfgang Denk schrieb:
> In message <1050985092.1476.13.camel at russ.local> you wrote:
>
>>wait, so the kernel actually boots, looks at the uninitialized hardware,
>>thinks for a moment, sticks its arm into the /dev/urandom bag, pulls out
>>a winner, and sticks it into seconds since epoch? On all the embedded
>>systems I've seen without a battery backed RTC, the clock is set to
>>epoch on boot. That would be really broken behavior to never initialize
>>the RTC, or to initialize it to a random value.
>
>
> You haven't seen many embedded systems, then.
>
> Uninitialized time is pretty usual on such systems. In quite a lot of
> applications the actual date / time does not play a role and so
> nobody bothers about it.
>
> There are even embedded systems _with_ a RTC which come up with an
> uninitialized value. For example, the MPC8xx family of PowerPC
> processors has an internal RTC, which can be supplied from a battery
> nbackup, but so only a _very_ small percentage of systems actually
> provides a battery. On such systems, after poweron there is a random
> value in the RTC register.
>
> This is normal, nothing wrong here.
>
>
> If there is something broken here than it is the software that
> depends on being started after a certain date. Remember that all
> values of a time_t are legal values; times < 1970 are perfectly
> legal, too.
And as I've reported before: I've seen udhcpc hang when time is
initialized to a value before 1970.
Of course our customers will not be amused if the system hangs while
booting just because the battery is empty!
For now I fixed this by checking and setting the RTC value in the
bootloader U-Boot _before_ linux gets started!
regards,
Steven Scholz
More information about the busybox
mailing list