[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20170612191049.16724-1-avagin@openvz.org>
Date: Mon, 12 Jun 2017 12:10:49 -0700
From: Andrei Vagin <avagin@...nvz.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: linux-kernel@...r.kernel.org, Andrei Vagin <avagin@...nvz.org>
Subject: [PATCH] time: zero old_value in timer_settime
Currently timer_settime() returns random data in old_value
timer_settime(10, 0, {it_interval={tv_sec=0, tv_nsec=0},
it_value={tv_sec=2147483, tv_nsec=647000000}}, NULL) = 0
...
timer_settime(10, 0, {it_interval={tv_sec=0, tv_nsec=0},
it_value={tv_sec=0, tv_nsec=0}},
{it_interval={tv_sec=-1861316067,
tv_nsec=18446645490300239488},
it_value={tv_sec=-1852565060, tv_nsec=133}}) = 0
Fixes: eabdec043853 ("posix-timers: Zero settings value in common code")
Cc: Thomas Gleixner <tglx@...utronix.de>
Signed-off-by: Andrei Vagin <avagin@...nvz.org>
---
kernel/time/posix-timers.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index 6e7a70b1..e684cbb 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -833,6 +833,9 @@ SYSCALL_DEFINE4(timer_settime, timer_t, timer_id, int, flags,
if (!timr)
return -EINVAL;
+ if (rtn)
+ memset(rtn, 0, sizeof(*rtn));
+
kc = timr->kclock;
if (WARN_ON_ONCE(!kc || !kc->timer_set))
error = -EINVAL;
--
2.9.4
Powered by blists - more mailing lists