Commit 6eef6ea5 authored by Linus Torvalds's avatar Linus Torvalds Committed by Chris Wright

[PATCH] seclvl settime fix

Don't try to "validate" a non-existing timeval.

settime() with a NULL timeval is silly but legal.

Noticed by Dave Jones <davej@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
[chrisw: seclvl only]
Signed-off-by: default avatarChris Wright <chrisw@sous-sol.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent e8ef6e32
......@@ -369,7 +369,7 @@ static int seclvl_capable(struct task_struct *tsk, int cap)
static int seclvl_settime(struct timespec *tv, struct timezone *tz)
{
struct timespec now;
if (seclvl > 1) {
if (tv && seclvl > 1) {
now = current_kernel_time();
if (tv->tv_sec < now.tv_sec ||
(tv->tv_sec == now.tv_sec && tv->tv_nsec < now.tv_nsec)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment