[PATCH 8/9] arm64: sysreg: Reject an out-of-range register encoding
Steffen Eiden
seiden at linux.ibm.com
Mon Nov 23 03:04:20 PST 2026
On Mon, Nov 23, 2026 at 07:52:18AM +0000, Fuad Tabba wrote:
> The generator copies a register's op0, op1, CRn, CRm and op2 into
> SYS_<reg> without checking them. sys_reg() shifts each into place
> without masking it, so a value too wide for its field spills into the
> next one. SYS_<reg> then names a different register's encoding, and the
> build doesn't report it.
>
> Require each of the five to be a decimal number that fits its field (two
> bits for op0, three for op1 and op2, four for CRn and CRm). Reject a
> leading zero too, since C reads such a value as octal.
>
> Signed-off-by: Fuad Tabba <fuad.tabba at linux.dev>
Reviewed-by: Steffen Eiden <seiden at linux.ibm.com>
More information about the linux-arm-kernel
mailing list