]> git.baikalelectronics.ru Git - kernel.git/commit
rseq: Kill process when unknown flags are encountered in ABI structures
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 22 Jun 2022 19:46:17 +0000 (15:46 -0400)
committerIngo Molnar <mingo@kernel.org>
Mon, 1 Aug 2022 13:21:42 +0000 (15:21 +0200)
commitd2975558b7aa9dce322a016479e538d9e003c77d
tree42766eda34c549222a5979e8ec1c3d58e6db06c1
parentd2d530a53a0f4269c2ddbbf883e730479b3d3526
rseq: Kill process when unknown flags are encountered in ABI structures

rseq_abi()->flags and rseq_abi()->rseq_cs->flags 29 upper bits are
currently unused.

The current behavior when those bits are set is to ignore them. This is
not an ideal behavior, because when future features will start using
those flags, if user-space fails to correctly validate that the kernel
indeed supports those flags (e.g. with a new sys_rseq flags bit) before
using them, it may incorrectly assume that the kernel will handle those
flags way when in fact those will be silently ignored on older kernels.

Validating that unused flags bits are cleared will allow a smoother
transition when those flags will start to be used by allowing
applications to fail early, and obviously, when they attempt to use the
new flags on an older kernel that does not support them.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lkml.kernel.org/r/20220622194617.1155957-2-mathieu.desnoyers@efficios.com
kernel/rseq.c