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)
Fri, Jun 21, 9:32 AM
Unknown Object (File)
Feb 8 2024, 7:39 PM
Unknown Object (File)
Feb 8 2024, 5:43 PM
Unknown Object (File)
Jan 8 2024, 6:38 PM
Unknown Object (File)
Dec 25 2023, 6:08 PM
Unknown Object (File)
Dec 22 2023, 10:05 PM
Unknown Object (File)
Dec 18 2023, 6:42 AM
Unknown Object (File)
Sep 4 2023, 3:02 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.