acrn-kernel/arch/um/kernel
Johannes Berg 4f7dad73df um: time-travel: fix time corruption
[ Upstream commit abe4eaa8618bb36c2b33e9cdde0499296a23448c ]

In 'basic' time-travel mode (without =inf-cpu or =ext), we
still get timer interrupts. These can happen at arbitrary
points in time, i.e. while in timer_read(), which pushes
time forward just a little bit. Then, if we happen to get
the interrupt after calculating the new time to push to,
but before actually finishing that, the interrupt will set
the time to a value that's incompatible with the forward,
and we'll crash because time goes backwards when we do the
forwarding.

Fix this by reading the time_travel_time, calculating the
adjustment, and doing the adjustment all with interrupts
disabled.

Reported-by: Vincent Whitchurch <Vincent.Whitchurch@axis.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-02-05 20:12:57 +00:00
..
skas Peter Zijlstra says: 2022-01-11 17:24:45 -08:00
Makefile um: Add devicetree support 2021-12-22 20:35:01 +01:00
asm-offsets.c
config.c.in
dtb.c um: Fix order of dtb unflatten/early init 2022-03-11 10:44:43 +01:00
dyn.lds.S UML: add support for KASAN under x86_64 2022-07-17 23:35:22 +02:00
early_printk.c
exec.c ptrace/um: Replace PT_DTRACE with TIF_SINGLESTEP 2022-05-11 14:33:33 -05:00
exitcode.c
gprof_syms.c
initrd.c um: Extract load file helper from initrd.c 2021-12-22 20:32:36 +01:00
ioport.c um: add PCI over virtio emulation driver 2021-06-17 21:45:43 +02:00
irq.c um: add PCI over virtio emulation driver 2021-06-17 21:45:43 +02:00
kmsg_dump.c printk: introduce a kmsg_dump iterator 2021-03-08 11:43:27 +01:00
ksyms.c um: rename set_signals() to um_set_signals() 2021-12-21 21:13:44 +01:00
load_file.c um: Extract load file helper from initrd.c 2021-12-22 20:32:36 +01:00
maccess.c maccess: rename probe_kernel_{read,write} to copy_{from,to}_kernel_nofault 2020-06-17 10:57:41 -07:00
mem.c - The usual batches of cleanups from Baoquan He, Muchun Song, Miaohe 2022-08-05 16:32:45 -07:00
physmem.c um: Fix comment typo 2022-09-19 23:05:46 +02:00
process.c um: Fix naming clash between UML and scheduler 2024-02-05 20:12:57 +00:00
ptrace.c ptrace/um: Replace PT_DTRACE with TIF_SINGLESTEP 2022-05-11 14:33:33 -05:00
reboot.c
sigio.c um: Support dynamic IRQ allocation 2020-12-13 22:22:08 +01:00
signal.c ptrace/um: Replace PT_DTRACE with TIF_SINGLESTEP 2022-05-11 14:33:33 -05:00
stacktrace.c UML: add support for KASAN under x86_64 2022-07-17 23:35:22 +02:00
sysrq.c um: Prevent KASAN splats in dump_stack() 2022-09-19 22:58:48 +02:00
time.c um: time-travel: fix time corruption 2024-02-05 20:12:57 +00:00
tlb.c um: remove vma linked list walk 2022-09-26 19:46:20 -07:00
trap.c mm: always expand the stack with the mmap write lock held 2023-07-01 13:16:25 +02:00
um_arch.c um/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 20:03:47 +02:00
um_arch.h um: Add devicetree support 2021-12-22 20:35:01 +01:00
umid.c uml: Remove the initialization of statics to 0 2022-09-19 23:10:07 +02:00
uml.lds.S arch: um: Fix build for statically linked UML w/ constructors 2022-07-17 23:14:34 +02:00
vmlinux.lds.S UML: define RUNTIME_DISCARD_EXIT 2023-03-17 08:50:32 +01:00