Project

General

Profile

Actions

Bug #14262

open

ntp_adjtime() should only validate constant with MOD_TIMECONST

Added by Andy Fiddaman 10 days ago. Updated 10 days ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

The ntp_adjtime() system call validates that the offset field in the timex struct passed in is within a valid range, even if it has not been asked to set it.

This is different to other operating systems which ignore that value unless it is being set, and even then will silently correct an invalid value (FreeBSD, Linux)

and has led to workarounds appearing in various pieces of software, for example
https://github.com/mlichvar/chrony/blob/master/sys_timex.c#L262 has this:

#ifdef SOLARIS
  /* The kernel seems to check the constant even when it's not being set */
  if (!(txc->modes & MOD_TIMECONST))
    txc->constant = 10;
#endif
Actions #1

Updated by Electric Monk 10 days ago

  • Gerrit CR set to 1821
Actions

Also available in: Atom PDF