No description
Find a file
Thomas Gleixner 3cc7935d32 tick/common: Align tick period during sched_timer setup
commit 13bb06f8dd upstream.

The tick period is aligned very early while the first clock_event_device is
registered. At that point the system runs in periodic mode and switches
later to one-shot mode if possible.

The next wake-up event is programmed based on the aligned value
(tick_next_period) but the delta value, that is used to program the
clock_event_device, is computed based on ktime_get().

With the subtracted offset, the device fires earlier than the exact time
frame. With a large enough offset the system programs the timer for the
next wake-up and the remaining time left is too small to make any boot
progress. The system hangs.

Move the alignment later to the setup of tick_sched timer. At this point
the system switches to oneshot mode and a high resolution clocksource is
available. At this point it is safe to align tick_next_period because
ktime_get() will now return accurate (not jiffies based) time.

[bigeasy: Patch description + testing].

Fixes: e9523a0d81 ("tick/common: Align tick period with the HZ tick.")
Reported-by: Mathias Krause <minipli@grsecurity.net>
Reported-by: "Bhatnagar, Rishabh" <risbhat@amazon.com>
Suggested-by: Mathias Krause <minipli@grsecurity.net>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Richard W.M. Jones <rjones@redhat.com>
Tested-by: Mathias Krause <minipli@grsecurity.net>
Acked-by: SeongJae Park <sj@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/5a56290d-806e-b9a5-f37c-f21958b5a8c0@grsecurity.net
Link: https://lore.kernel.org/12c6f9a3-d087-b824-0d05-0d18c9bc1bf3@amazon.com
Link: https://lore.kernel.org/r/20230615091830.RxMV2xf_@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-28 10:28:06 +02:00
arch um: Fix build w/o CONFIG_PM_SLEEP 2023-06-21 15:45:41 +02:00
block block/blk-iocost (gcc13): keep large values in a new enum 2023-06-14 11:09:33 +02:00
certs certs/blacklist_hashes.c: fix const confusion in certs blacklist 2022-06-22 14:13:17 +02:00
crypto KEYS: asymmetric: Copy sig and digest in public_key_verify_signature() 2023-06-09 10:30:17 +02:00
Documentation Remove DECnet support from kernel 2023-06-21 15:45:38 +02:00
drivers drm/amd/display: fix the system hang while disable PSR 2023-06-28 10:28:06 +02:00
fs nilfs2: reject devices with insufficient block count 2023-06-21 15:45:41 +02:00
include media: dvb-core: Fix use-after-free due to race at dvb_register_device() 2023-06-21 15:45:41 +02:00
init kbuild: check the minimum assembler version in Kconfig 2023-04-20 12:10:28 +02:00
io_uring io_uring: hold uring mutex around poll removal 2023-06-21 15:45:37 +02:00
ipc ipc/sem: Fix dangling sem_array access in semtimedop race 2022-12-08 11:24:00 +01:00
kernel tick/common: Align tick period during sched_timer setup 2023-06-28 10:28:06 +02:00
lib test_firmware: fix a memory leak with reqs buffer 2023-06-21 15:45:35 +02:00
LICENSES LICENSES/deprecated: add Zlib license text 2020-09-16 14:33:49 +02:00
mm mm/memory_hotplug: extend offline_and_remove_memory() to handle more than one memory block 2023-06-21 15:45:40 +02:00
net net/sched: Refactor qdisc_graft() for ingress and clsact Qdiscs 2023-06-28 10:28:06 +02:00
samples samples/bpf: Fix fout leak in hbm's run_bpf_prog 2023-05-30 12:57:49 +01:00
scripts gcc-plugins: Reorganize gimple includes for GCC 13 2023-06-14 11:09:30 +02:00
security selinux: don't use make's grouped targets feature yet 2023-06-09 10:30:16 +02:00
sound ALSA: hda/realtek: Add a quirk for Compaq N14JP6 2023-06-21 15:45:37 +02:00
tools selftests/ptp: Fix timestamp printf format for PTP_SYS_OFFSET 2023-06-21 15:45:40 +02:00
usr usr/include/Makefile: add linux/nfc.h to the compile-test coverage 2022-02-01 17:25:48 +01:00
virt KVM: fix memoryleak in kvm_init() 2023-04-05 11:23:43 +02:00
.clang-format RDMA 5.10 pull request 2020-10-17 11:18:18 -07:00
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore kbuild: generate Module.symvers only when vmlinux exists 2021-05-19 10:12:59 +02:00
.mailmap mailmap: add two more addresses of Uwe Kleine-König 2020-12-06 10:19:07 -08:00
COPYING
CREDITS MAINTAINERS: Move Jason Cooper to CREDITS 2020-11-30 10:20:34 +01:00
Kbuild
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS Remove DECnet support from kernel 2023-06-21 15:45:38 +02:00
Makefile Linux 5.10.185 2023-06-21 15:45:41 +02:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.