Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • I ipipe
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Activity
  • Graph
  • Commits
Collapse sidebar
  • xenomai
  • ipipe
  • Repository

Switch branch/tag
  • ipipe
  • kernel
  • time
  • ntp.c
Find file BlameHistoryPermalink
  • John Stultz's avatar
    ntp: Fixup adjtimex freq validation on 32-bit systems · 29183a70
    John Stultz authored Feb 09, 2015
    Additional validation of adjtimex freq values to avoid
    potential multiplication overflows were added in commit
    5e5aeb43 (time: adjtimex: Validate the ADJ_FREQUENCY values)
    
    Unfortunately the patch used LONG_MAX/MIN instead of
    LLONG_MAX/MIN, which was fine on 64-bit systems, but being
    much smaller on 32-bit systems caused false positives
    resulting in most direct frequency adjustments to fail w/
    EINVAL.
    
    ntpd only does direct frequency adjustments at startup, so
    the issue was not as easily observed there, but other time
    sync applications like ptpd and chrony were more effected by
    the bug.
    
    See bugs:
    
      https://bugzilla.kernel.org/show_bug.cgi?id=92481
      https://bugzilla.redhat.com/show_bug.cgi?id=1188074
    
    
    
    This patch changes the checks to use LLONG_MAX for
    clarity, and additionally the checks are disabled
    on 32-bit systems since LLONG_MAX/PPM_SCALE is always
    larger then the 32-bit long freq value, so multiplication
    overflows aren't possible there.
    Reported-by: default avatarJosh Boyer <jwboyer@fedoraproject.org>
    Reported-by: default avatarGeorge Joseph <george.joseph@fairview5.com>
    Tested-by: default avatarGeorge Joseph <george.joseph@fairview5.com>
    Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
    Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
    Cc: <stable@vger.kernel.org> # v3.19+
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Sasha Levin <sasha.levin@oracle.com>
    Link: http://lkml.kernel.org/r/1423553436-29747-1-git-send-email-john.stultz@linaro.org
    
    
    [ Prettified the changelog and the comments a bit. ]
    Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
    29183a70

Replace ntp.c

Attach a file by drag & drop or click to upload


Cancel
GitLab will create a branch in your fork and start a merge request.

Imprint & Privacy Policy