]> git.baikalelectronics.ru Git - kernel.git/commit
ntp: fix non privileged system time shifting
authorRichard Cochran <richardcochran@gmail.com>
Mon, 4 Apr 2011 15:31:23 +0000 (08:31 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 4 Apr 2011 15:31:23 +0000 (08:31 -0700)
commitc52ceb686103f5075b9112421f74240e434157a0
tree26b9d37f5a41b4c01d800a444ad230eafb48e47a
parent17d55ab4278a8a493d4ac9804d0f22e22f1eee15
ntp: fix non privileged system time shifting

The ADJ_SETOFFSET bit added in commit 7c7d8d0b ("ntp: Add ADJ_SETOFFSET
mode bit") also introduced a way for any user to change the system time.
Sneaky or buggy calls to adjtimex() could set

    ADJ_OFFSET_SS_READ | ADJ_SETOFFSET

which would result in a successful call to timekeeping_inject_offset().
This patch fixes the issue by adding the capability check.

Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/time/ntp.c