提交 951069e3 编写于 作者: L Linus Torvalds

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: NLinus Torvalds <torvalds@osdl.org>
上级 3ee68c4a
......@@ -155,7 +155,7 @@ int do_sys_settimeofday(struct timespec *tv, struct timezone *tz)
static int firsttime = 1;
int error = 0;
if (!timespec_valid(tv))
if (tv && !timespec_valid(tv))
return -EINVAL;
error = security_settime(tv, tz);
......
......@@ -368,8 +368,8 @@ 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) {
struct timespec now;
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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册