[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210414030449.90692-1-chenjun102@huawei.com>
Date: Wed, 14 Apr 2021 03:04:49 +0000
From: Chen Jun <chenjun102@...wei.com>
To: <linux-kernel@...r.kernel.org>
CC: <tglx@...utronix.de>, <richardcochran@...il.com>,
<johnstul@...ibm.com>, <rui.xiang@...wei.com>
Subject: [PATCH v2] time: Fix overwrite err unexpected in clock_adjtime32
the correct error is covered by put_old_timex32.
Fixes: 3a4d44b61625 ("ntp: Move adjtimex related compat syscalls to native counterparts")
Signed-off-by: Chen Jun <chenjun102@...wei.com>
---
v2: Make "Fixes" tag correct
kernel/time/posix-timers.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index bf540f5a..dd5697d 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -1191,8 +1191,8 @@ SYSCALL_DEFINE2(clock_adjtime32, clockid_t, which_clock,
err = do_clock_adjtime(which_clock, &ktx);
- if (err >= 0)
- err = put_old_timex32(utp, &ktx);
+ if (err >= 0 && put_old_timex32(utp, &ktx))
+ return -EFAULT;
return err;
}
--
2.9.4
Powered by blists - more mailing lists