]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rseq: Implement read only ABI enforcement for optimized RSEQ V2 mode
authorThomas Gleixner <tglx@kernel.org>
Sun, 26 Apr 2026 14:21:02 +0000 (16:21 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 6 May 2026 15:40:15 +0000 (17:40 +0200)
commit82f572449cfe75f12ea985986da60e11f308f77d
tree6fdfa3e6253916f9f5fb690c6ef9fb16f0ebb0f1
parentfdf4eb632683bfc2840acebe62716cb468d43e10
rseq: Implement read only ABI enforcement for optimized RSEQ V2 mode

The optimized RSEQ V2 mode requires that user space adheres to the ABI
specification and does not modify the read-only fields cpu_id_start,
cpu_id, node_id and mm_cid behind the kernel's back.

While the kernel does not rely on these fields, the adherence to this is a
fundamental prerequisite to allow multiple entities, e.g. libraries, in an
application to utilize the full potential of RSEQ without stepping on each
other toes.

Validate this adherence on every update of these fields. If the kernel
detects that user space modified the fields, the application is force
terminated.

Fixes: d6200245c75e ("rseq: Allow registering RSEQ with slice extension")
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Tested-by: Dmitry Vyukov <dvyukov@google.com>
Link: https://patch.msgid.link/20260428224427.845230956%40kernel.org
Cc: stable@vger.kernel.org
include/linux/rseq_entry.h
include/linux/rseq_types.h
kernel/rseq.c