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, Apr 6, 11:30 AM
Unknown Object (File)
Fri, Apr 3, 5:15 AM
Unknown Object (File)
Thu, Apr 2, 11:30 AM
Unknown Object (File)
Tue, Mar 31, 2:09 AM
Unknown Object (File)
Thu, Mar 26, 3:13 PM
Unknown Object (File)
Wed, Mar 25, 8:44 PM
Unknown Object (File)
Wed, Mar 25, 6:22 AM
Unknown Object (File)
Sat, Mar 21, 2: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.