Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/compat/netbsd32



On 2016/11/16 18:33, Michael van Elst wrote:
There is a slight twist.

If NTP isn't defined, the code will call the standard (64bit)
ioctl handler with the assumption that the arg uses the same
layout in 64bit and 32bit mode.

If the ioctl handler is builtin, it won't understand the ioctl either
and everything is fine. But if it is a loaded module, it might be
compiled with different NTP option and so the wrong routine is called.

Fortunately that's just theoretical because the module can't be loaded
when compiled differently (because it references ntp_adjtime). But
that is a different issue and might be solved in the future.

So I suggest to make the compat32 code handle CLOCK_NTP_ADJTIME even
when compiled with !NTP but just return ENOTTY.

N.B. clockctlioctl returns EINVAL for unrecognized ioctl commands,
it should also return ENOTTY.

Thank you for pointing out the possible failure. Your suggestion
sounds good to me.

Thanks,
Rin


Home | Main Index | Thread Index | Old Index