android_kernel_xiaomi_sm7250/kernel/time
Chen Jun 1a852780d9 posix-timers: Preserve return value in clock_adjtime32()
commit 2d036dfa5f10df9782f5278fc591d79d283c1fad upstream.

The return value on success (>= 0) is overwritten by the return value of
put_old_timex32(). That works correct in the fault case, but is wrong for
the success case where put_old_timex32() returns 0.

Just check the return value of put_old_timex32() and return -EFAULT in case
it is not zero.

[ tglx: Massage changelog ]

Fixes: 3a4d44b616 ("ntp: Move adjtimex related compat syscalls to native counterparts")
Signed-off-by: Chen Jun <chenjun102@huawei.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Richard Cochran <richardcochran@gmail.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20210414030449.90692-1-chenjun102@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-22 10:59:21 +02:00
..
alarmtimer.c kernel, fs: Introduce and use set_restart_fn() and arch_set_restart_data() 2021-03-24 11:07:37 +01:00
clockevents.c
clocksource.c
hrtimer.c kernel, fs: Introduce and use set_restart_fn() and arch_set_restart_data() 2021-03-24 11:07:37 +01:00
itimer.c time: Prevent undefined behaviour in timespec64_to_ns() 2020-11-18 19:18:40 +01:00
jiffies.c
Kconfig
Makefile
ntp_internal.h
ntp.c
posix-clock.c
posix-cpu-timers.c kernel, fs: Introduce and use set_restart_fn() and arch_set_restart_data() 2021-03-24 11:07:37 +01:00
posix-stubs.c
posix-timers.c posix-timers: Preserve return value in clock_adjtime32() 2021-05-22 10:59:21 +02:00
posix-timers.h
sched_clock.c
test_udelay.c
tick-broadcast-hrtimer.c
tick-broadcast.c
tick-common.c tick/common: Touch watchdog in tick_unfreeze() on all CPUs 2020-11-18 19:18:46 +01:00
tick-internal.h
tick-oneshot.c
tick-sched.c
tick-sched.h
time.c
timeconst.bc
timeconv.c
timecounter.c
timekeeping_debug.c
timekeeping_internal.h
timekeeping.c timekeeping: Prevent 32bit truncation in scale64_check_overflow() 2020-10-01 13:14:36 +02:00
timekeeping.h
timer_list.c
timer.c random32: make prandom_u32() output unpredictable 2020-11-18 19:18:52 +01:00