]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
timekeeping: Fix timex status validation for auxiliary clocks
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 25 Feb 2026 08:51:35 +0000 (09:51 +0100)
committerThomas Gleixner <tglx@kernel.org>
Wed, 4 Mar 2026 19:05:37 +0000 (20:05 +0100)
commite48a869957a70cc39b4090cd27c36a86f8db9b92
tree6f5be54be639418a53ad74efd406dac7be208cdc
parent11439c4635edd669ae435eec308f4ab8a0804808
timekeeping: Fix timex status validation for auxiliary clocks

The timekeeping_validate_timex() function validates the timex status
of an auxiliary system clock even when the status is not to be changed,
which causes unexpected errors for applications that make read-only
clock_adjtime() calls, or set some other timex fields, but without
clearing the status field.

Do the AUX-specific status validation only when the modes field contains
ADJ_STATUS, i.e. the application is actually trying to change the
status. This makes the AUX-specific clock_adjtime() behavior consistent
with CLOCK_REALTIME.

Fixes: 4eca49d0b621 ("timekeeping: Prepare do_adtimex() for auxiliary clocks")
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260225085231.276751-1-mlichvar@redhat.com
kernel/time/timekeeping.c