Page MenuHomeFreeBSD

Fix compat32 for ntp_adjtime(2).
ClosedPublic

Authored by kib on Dec 3 2020, 10:00 PM.
Tags
None
Referenced Files
F148317971: D27471.id80286.diff
Tue, Mar 17, 3:43 AM
Unknown Object (File)
Fri, Mar 13, 4:52 AM
Unknown Object (File)
Mon, Mar 9, 4:33 PM
Unknown Object (File)
Mon, Mar 9, 8:55 AM
Unknown Object (File)
Sun, Mar 8, 8:59 PM
Unknown Object (File)
Feb 15 2026, 1:40 AM
Unknown Object (File)
Feb 12 2026, 2:03 PM
Unknown Object (File)
Jan 5 2026, 3:26 AM

Details

Summary

Add kern_ntp_adjtime(9).
struct timex is not 32-bit safe, it uses longs for members. Provide translation.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 35182

Event Timeline

kib requested review of this revision.Dec 3 2020, 10:00 PM

I don't see any issues worth noting.

This revision is now accepted and ready to land.Dec 3 2020, 11:12 PM

I'd be tempted to pass timex_copyin and timex_copyout function pointers to kern_ntp_adjtime rather than having duplicate code in sys_ and freebsd32_. That would also simplify a future compat syscall implementation.

sys/kern/kern_ntptime.c
1089–1109

This looks like it's part of a future syscall revision, not the compat change?

kib marked an inline comment as done.Dec 3 2020, 11:42 PM

I'd be tempted to pass timex_copyin and timex_copyout function pointers to kern_ntp_adjtime rather than having duplicate code in sys_ and freebsd32_. That would also simplify a future compat syscall implementation.

Right now it seems there will be no compat syscall, ie struct timex is not going to change.

Do you still want copyin callbacks there ? It is more overhead in code for rather trivial wrappers IMO.

This revision now requires review to proceed.Dec 3 2020, 11:42 PM

Without a compat syscall it seems fine to leave this as is.

This revision is now accepted and ready to land.Dec 4 2020, 4:39 PM
This revision was automatically updated to reflect the committed changes.