Page MenuHomeFreeBSD

Fix compat32 for ntp_adjtime(2).
ClosedPublic

Authored by kib on Dec 3 2020, 10:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 6, 8:07 AM
Unknown Object (File)
Fri, Oct 3, 3:00 AM
Unknown Object (File)
Fri, Sep 19, 1:02 AM
Unknown Object (File)
Wed, Sep 17, 7:25 PM
Unknown Object (File)
Sep 15 2025, 1:54 PM
Unknown Object (File)
Sep 10 2025, 3:37 AM
Unknown Object (File)
Sep 10 2025, 2:11 AM
Unknown Object (File)
Sep 5 2025, 5:23 PM

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 Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #80286)

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.