Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NTP sync failure if offset with BIOS date is greater than a signed long #450

Open
yhemery opened this issue Aug 30, 2021 · 3 comments · May be fixed by #455
Open

NTP sync failure if offset with BIOS date is greater than a signed long #450

yhemery opened this issue Aug 30, 2021 · 3 comments · May be fixed by #455

Comments

@yhemery
Copy link

yhemery commented Aug 30, 2021

Hi,

On some servers with a BIOS date configured in 1921, the "ntp" iPXE command will succeed but the resulting system date is false. It looks this is due to an integer overflow starting here :

https://github.com/ipxe/ipxe/blob/master/src/net/udp/ntp.c#L116

When trying to boot an iPXE compiled with "DEBUG=ntp:1" on a server with a BIOS date in 1921, we get :

NTP 0xa068e6a8 sending request
NTP 0xa068e6a8 delta -1139207296 seconds

So, we end up with a negative offset instead of the expected value of 3153600000 seconds (100 years).

Feel free to ask if you need more details.

Yannick.

@NiKiZe
Copy link
Contributor

NiKiZe commented Aug 30, 2021

Just have to ask, on what hw is this, and how did the clock end up in that state?

@yhemery
Copy link
Author

yhemery commented Aug 30, 2021

Just have to ask, on what hw is this, and how did the clock end up in that state?

That's a Supermicro X11DPi-NT, they end up in 1921 if the CMOS battery is depleted or removed.

@yhemery
Copy link
Author

yhemery commented Sep 3, 2021

PR #455 created, validated on an impacted system with a BIOS date set to 1921.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants