]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
[PATCH] seclvl settime fix
authorLinus Torvalds <torvalds@osdl.org>
Wed, 1 Feb 2006 05:20:26 +0000 (21:20 -0800)
committerChris Wright <chrisw@sous-sol.org>
Fri, 10 Feb 2006 07:20:06 +0000 (23:20 -0800)
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: Linus Torvalds <torvalds@osdl.org>
[chrisw: seclvl only]
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
security/seclvl.c

index 1caac0164643c202a55c1e8394b9669706723591..136e8eca361876cb765a42be918e850354bedec7 100644 (file)
@@ -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)) {