kernel_samsung_a53x/kernel/time
Jinjie Ruan a2c183d885 posix-clock: posix-clock: Fix unbalanced locking in pc_clock_settime()
[ Upstream commit 6e62807c7fbb3c758d233018caf94dfea9c65dbd ]

If get_clock_desc() succeeds, it calls fget() for the clockid's fd,
and get the clk->rwsem read lock, so the error path should release
the lock to make the lock balance and fput the clockid's fd to make
the refcount balance and release the fd related resource.

However the below commit left the error path locked behind resulting in
unbalanced locking. Check timespec64_valid_strict() before
get_clock_desc() to fix it, because the "ts" is not changed
after that.

Fixes: d8794ac20a29 ("posix-clock: Fix missing timespec64 check in pc_clock_settime()")
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Acked-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
[pabeni@redhat.com: fixed commit message typo]
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-23 23:22:01 +01:00
..
alarmtimer.c alarmtimer: Minimize wakeup time 2024-11-19 18:05:33 +01:00
clockevents.c
clocksource.c
hrtimer.c hrtimer: Prevent queuing of hrtimer without a function callback 2024-11-23 23:20:47 +01:00
itimer.c
jiffies.c
Kconfig
Makefile
namespace.c
ntp.c ntp: Safeguard against time_constant overflow 2024-11-23 23:20:28 +01:00
ntp_internal.h
posix-clock.c posix-clock: posix-clock: Fix unbalanced locking in pc_clock_settime() 2024-11-23 23:22:01 +01:00
posix-cpu-timers.c
posix-stubs.c
posix-timers.c
posix-timers.h
sched_clock.c
test_udelay.c
tick-broadcast-hrtimer.c
tick-broadcast.c tick/broadcast: Move per CPU pointer access into the atomic section 2024-11-23 23:20:28 +01:00
tick-common.c tick/nohz_full: Don't abuse smp_call_function_single() in tick_setup_device() 2024-11-19 14:19:05 +01:00
tick-internal.h
tick-oneshot.c
tick-sched.c tick/sched: Preserve number of idle sleeps across CPU hotplug events 2024-11-18 12:13:07 +01:00
tick-sched.h
time.c
timeconst.bc
timeconv.c
timecounter.c
timekeeping.c timekeeping: Fix cross-timestamp interpolation for non-x86 2024-11-19 08:44:37 +01:00
timekeeping.h
timekeeping_debug.c
timekeeping_internal.h
timer.c timers: Rename del_timer_sync() to timer_delete_sync() 2024-11-19 09:22:14 +01:00
timer_list.c
vsyscall.c