From: Linus Torvalds Date: Wed, 1 Feb 2006 05:20:26 +0000 (-0800) Subject: [PATCH] seclvl settime fix X-Git-Tag: v2.6.15.4~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6eef6ea5bf6794c2d0938ba1c91934229ad9873e;p=thirdparty%2Fkernel%2Fstable.git [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 Signed-off-by: Linus Torvalds [chrisw: seclvl only] Signed-off-by: Chris Wright Signed-off-by: Greg Kroah-Hartman --- diff --git a/security/seclvl.c b/security/seclvl.c index 1caac0164643c..136e8eca36187 100644 --- a/security/seclvl.c +++ b/security/seclvl.c @@ -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)) {