]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tools/x86/kcpuid: Protect against faulty "max subleaf" values
authorAhmed S. Darwish <darwi@linutronix.de>
Thu, 18 Jul 2024 13:47:44 +0000 (15:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2024 13:11:28 +0000 (15:11 +0200)
commitdacec3a3248f38153b924673029c17e8bc0de228
tree7a77830946d5a092d7604ceeab979d93a15cc410
parentd6a62fcfd494d72cf28f534108595da7aecd3f39
tools/x86/kcpuid: Protect against faulty "max subleaf" values

[ Upstream commit cf96ab1a966b87b09fdd9e8cc8357d2d00776a3a ]

Protect against the kcpuid code parsing faulty max subleaf numbers
through a min() expression.  Thus, ensuring that max_subleaf will always
be ≤ MAX_SUBLEAF_NUM.

Use "u32" for the subleaf numbers since kcpuid is compiled with -Wextra,
which includes signed/unsigned comparisons warnings.

Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20240718134755.378115-5-darwi@linutronix.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/arch/x86/kcpuid/kcpuid.c