]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rseq: Rework the TIF_NOTIFY handler
authorThomas Gleixner <tglx@linutronix.de>
Mon, 27 Oct 2025 08:45:12 +0000 (09:45 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 4 Nov 2025 07:33:54 +0000 (08:33 +0100)
commite2d4f42271155045a49b89530f2c06ad8e9f1a1e
tree7bbcc777437960b76a44fdf45c1b42e9d0dd473f
parent9f6ffd4cebda86841700775de3213f22bb0ea22d
rseq: Rework the TIF_NOTIFY handler

Replace the whole logic with a new implementation, which is shared with
signal delivery and the upcoming exit fast path.

Contrary to the original implementation, this ignores invocations from
KVM/IO-uring, which invoke resume_user_mode_work() with the @regs argument
set to NULL.

The original implementation updated the CPU/Node/MM CID fields, but that
was just a side effect, which was addressing the problem that this
invocation cleared TIF_NOTIFY_RESUME, which in turn could cause an update
on return to user space to be lost.

This problem has been addressed differently, so that it's not longer
required to do that update before entering the guest.

That might be considered a user visible change, when the hosts thread TLS
memory is mapped into the guest, but as this was never intentionally
supported, this abuse of kernel internal implementation details is not
considered an ABI break.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://patch.msgid.link/20251027084307.517640811@linutronix.de
include/linux/rseq_entry.h
kernel/rseq.c