Commit c721af6d authored by Adrian Bunk's avatar Adrian Bunk Committed by Chris Wright

[PATCH] security/seclvl.c: fix time wrap (CVE-2005-4352)

initlvl=2 in seclvl gives the guarantee
"Cannot decrement the system time".

But it was possible to set the time to the maximum unixtime value
(19 Jan 2038) resulting in a wrap to the minimum value.

This patch fixes this by disallowing setting the time to any date
after 2030 with initlvl=2.

This patch does not apply to kernel 2.6.19 since the seclvl module was
already removed in this kernel.
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
Signed-off-by: default avatarChris Wright <chrisw@sous-sol.org>
parent 9a74fa0d
......@@ -370,6 +370,8 @@ static int seclvl_settime(struct timespec *tv, struct timezone *tz)
current->group_leader->pid);
return -EPERM;
} /* if attempt to decrement time */
if (tv->tv_sec > 1924988400) /* disallow dates after 2030) */
return -EPERM; /* CVE-2005-4352 */
} /* if seclvl > 1 */
return 0;
}
......
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