From nobody Fri Apr 3 06:26:52 2026 Received: from smtpout.efficios.com (smtpout.efficios.com [158.69.130.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5867C30AACF for ; Wed, 18 Feb 2026 16:52:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=158.69.130.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771433554; cv=none; b=eyc6Bs3qMX+FeYRyzemMEhInkrrkq1RwzMjSAIN1b9PwSBErXl7y+hKdB6c1jyGP8h9wUBIqJ7lTzJEFlCOvjGLXhoe3u9UkP0EWClxU7n958ao5szb9P7xf5cktPRK9EPjOgDjVbYI1bPbimzS5p50uh/Fs3jeMUornkSJBmd4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771433554; c=relaxed/simple; bh=L1wLMHI0oI0LjxHlc2YwsZo354xzGirQ7xFxSyvfON0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rjsB5t4J0KwUtclP0IeL+cXiWcX+b+7hxJZ2gto/gbrBxMKiCPnwkyAgW3t8TdwbIlXdSx/Yb0qSWJyQyihLBKAWZnopRU62Bmo4nsF4QUDQrENrqBVYhflCZ/Gw1zOUxheU+/mTSrnjF0R9Lwg1u6dkx1PW3HUjQcTm0DO/mrk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=efficios.com; spf=pass smtp.mailfrom=efficios.com; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b=WZCP+t1V; arc=none smtp.client-ip=158.69.130.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=efficios.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b="WZCP+t1V" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=smtpout1; t=1771433546; bh=NnvSvLNsHWWpbpKQkIRk4qePKv6sL5zIgZ0CeBrrNOg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WZCP+t1V9b4TIhxlF1rEc1bKJQ8uXer+0Zc685fVIsKfoSqQxq7acH8qD8yn6/3uc bRbzVCCW5w/rrtYkUf6LhOyWIb49aKP/D2c1F8weZLgnjmybbaFXNBRQGcupR572l5 4ID3ySgwfJRRSlx7neWfKkRTYPDSu3/bIUwcA58Dyeu8dTCDtQNlxwEU0UCu7HzgWz eUpR/6CsWFE58GKmHw/51UEQMppIqNTlJcARNYx4JqB5QdJw/V9yNSQWUMnw2SS5YI 9CzZMFsuK1QzOf98qGV2qsMZ9RwjhJdBlyIzk+54B1I9tTsn9PVGK5oaY0C39to9LN daZreBpph968w== Received: from thinkos.internal.efficios.com (mtl.efficios.com [216.120.195.104]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4fGMxk4VVhzFC9; Wed, 18 Feb 2026 11:52:26 -0500 (EST) From: Mathieu Desnoyers To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , Ingo Molnar , Thomas Gleixner , Carlos O'Donell , Florian Weimer , Michael Jeanson Subject: [PATCH v1 1/2] rseq: Clarify rseq registration rseq_size bound check comment Date: Wed, 18 Feb 2026 11:52:13 -0500 Message-Id: <20260218165214.1164084-2-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260218165214.1164084-1-mathieu.desnoyers@efficios.com> References: <20260218165214.1164084-1-mathieu.desnoyers@efficios.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The rseq registration validates that the rseq_size argument is greater or equal to 32 (the original rseq size), but the comment associated with this check does not clearly state this. Clarify the comment to that effect. Fixes: ee3e3ac05c26 ("rseq: Introduce extensible rseq ABI") Signed-off-by: Mathieu Desnoyers CC: Peter Zijlstra (Intel) CC: Ingo Molnar CC: Thomas Gleixner --- kernel/rseq.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/rseq.c b/kernel/rseq.c index b0973d19f366..e349f86cc945 100644 --- a/kernel/rseq.c +++ b/kernel/rseq.c @@ -449,8 +449,9 @@ SYSCALL_DEFINE4(rseq, struct rseq __user *, rseq, u32, = rseq_len, int, flags, u32 * auxiliary vector AT_RSEQ_ALIGN. If rseq_len is the original rseq * size, the required alignment is the original struct rseq alignment. * - * In order to be valid, rseq_len is either the original rseq size, or - * large enough to contain all supported fields, as communicated to + * The rseq_len is required to be greater or equal to the original rseq + * size. In order to be valid, rseq_len is either the original rseq size, + * or large enough to contain all supported fields, as communicated to * user-space through the ELF auxiliary vector AT_RSEQ_FEATURE_SIZE. */ if (rseq_len < ORIG_RSEQ_SIZE || --=20 2.39.5 From nobody Fri Apr 3 06:26:52 2026 Received: from smtpout.efficios.com (smtpout.efficios.com [158.69.130.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 299A933374B for ; Wed, 18 Feb 2026 16:52:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=158.69.130.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771433555; cv=none; b=OfOqz7yk3AwRt0Or+68afqr5yM9sHeq8ekdj5VnEpQQyG+gnOw7rjBuz/oFVbmrio5nsX+hCE8leaMs+YkrhEDqlrp2a9u4r99td7FWcNCtxsD9EJh6T/sHyB0QMi19S5dKcy4//MO9Ot8Yxc7ZQhJ/pEFJoWv4snI14Ro8TOcA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771433555; c=relaxed/simple; bh=ifFkrC0ux757RwH+3I6j4Kf+s7uac/s6pgmAPKrUU14=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HSpUbklLSBrgNEAONC8sChXp0rq9Jgh6+Qz5dfhAeCOZ6HSwx+EhvVgJ/vXxDXL2dD/2LJQ84XYa+JWGQQTq1uQ/h0K/4sD32v0b2YxXgIrosiCoz8NlpFYGKWQrXZ05uDR/N3QDfNhlnPyhxZL/pGNzt7rIDYijYfMv+hcWrhE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=efficios.com; spf=pass smtp.mailfrom=efficios.com; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b=d23TsKJO; arc=none smtp.client-ip=158.69.130.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=efficios.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b="d23TsKJO" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=smtpout1; t=1771433546; bh=jxY5GgXXHTNVU84zcZGEGYjlA9IYYDY3yJuRiudBiLU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d23TsKJO0qeUv3tdVsm8NjHyLhQaZU3hVhXgxg8WH9ZD5EZb+9VNqhqALnFPSIqJC v8qnrv5hZy7Ro6N3cYD/1DoRgDDBZGWWf3Iur3p1OmNu7AXrstFTFjb/5CKarqAVA3 3A+Mg3OK50xRkalhc21FH8humpAjj2XuzteNKg1IrBKfZXjo9T3AzZt3eWikRChpQU CJ1GvmqNRNJ8x5i4Mkbl9ZvLCiF1pUJMo77reFm5xjmA+UWhArvrN9o3MALgrk2XrG aCsw6QlYc7YYpSdbDUTuOsXAw82vEQdSiP3ac1tk+RSTjg+4N+0hs37t3Q+xuPELHQ CoCA/mcCOgq3g== Received: from thinkos.internal.efficios.com (mtl.efficios.com [216.120.195.104]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4fGMxk5KJhzFyN; Wed, 18 Feb 2026 11:52:26 -0500 (EST) From: Mathieu Desnoyers To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , Ingo Molnar , Thomas Gleixner , Carlos O'Donell , Florian Weimer , Michael Jeanson Subject: [PATCH v1 2/2] rseq: slice ext: Ensure rseq feature size differs from original rseq size Date: Wed, 18 Feb 2026 11:52:14 -0500 Message-Id: <20260218165214.1164084-3-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260218165214.1164084-1-mathieu.desnoyers@efficios.com> References: <20260218165214.1164084-1-mathieu.desnoyers@efficios.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Before rseq became extensible, its original size was 32 bytes even though the active rseq area was only 20 bytes. This had the following impact in terms of userspace ecosystem evolution: * The GNU libc between 2.35 and 2.39 expose a __rseq_size symbol set to 32, even though the size of the active rseq area is really 20. * The GNU libc 2.40 changes this __rseq_size to 20, thus making it express the active rseq area. * Starting from glibc 2.41, __rseq_size corresponds to the AT_RSEQ_FEATURE_SIZE from getauxval(3). This means that users of __rseq_size can always expect it to correspond to the active rseq area, except for the value 32, for which the active rseq area is 20 bytes. Exposing a 32 bytes feature size would make life needlessly painful for userspace. Therefore, add a reserved field at the end of the rseq area to bump the feature size to 33 bytes. This reserved field is expected to be replaced with whatever field will come next, expecting that this field will be larger than 1 byte. The effect of this change is to increase the size and alignment of the rseq area from 32 to 64 bytes before we actually have fields using that memory. This will minimize the amount of ABI corner-cases we need to document and require userspace to play games with. The rule stays simple when __rseq_size !=3D 32: #define rseq_field_available(field) (__rseq_size >=3D offsetofend(struct = rseq_abi, field)) Signed-off-by: Mathieu Desnoyers CC: Peter Zijlstra (Intel) CC: Ingo Molnar CC: Thomas Gleixner CC: Carlos O'Donell CC: Florian Weimer CC: Michael Jeanson --- include/uapi/linux/rseq.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/rseq.h b/include/uapi/linux/rseq.h index 863c4a00a66b..281edb85a5f5 100644 --- a/include/uapi/linux/rseq.h +++ b/include/uapi/linux/rseq.h @@ -180,10 +180,21 @@ struct rseq { */ struct rseq_slice_ctrl slice_ctrl; =20 + /* + * Before rseq became extensible, its original size was 32 bytes even + * though the active rseq area was only 20 bytes. + * Exposing a 32 bytes feature size would make life needlessly painful + * for userspace. Therefore, add a reserved byte after byte 32 + * to bump the rseq feature size from 32 to 33. + * The next field to be added to the rseq area will be larger + * than one byte, and will replace this reserved byte. + */ + __u8 __reserved; + /* * Flexible array member at end of structure, after last feature field. */ char end[]; -} __attribute__((aligned(4 * sizeof(__u64)))); +} __attribute__((aligned(8 * sizeof(__u64)))); =20 #endif /* _UAPI_LINUX_RSEQ_H */ --=20 2.39.5