]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
s390/diag: Add missing array_index_nospec() call to memtop_get_page_count()
authorHeiko Carstens <hca@linux.ibm.com>
Mon, 22 Jun 2026 14:31:24 +0000 (16:31 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Wed, 8 Jul 2026 15:02:47 +0000 (17:02 +0200)
commitb7577fe4c47a31ca7c99714c53244a44af03cdfe
tree94352eeea81d10f42860b203a870bb09c51192b5
parent8cdeaa50eae8dad34885515f62559ee83e7e8dda
s390/diag: Add missing array_index_nospec() call to memtop_get_page_count()

'level' is user space controlled and used to read from an array. Add the
missing array_index_nospec() call to prevent speculative execution.

Cc: stable@vger.kernel.org
Fixes: 0d30871739ab ("s390/diag: Add memory topology information via diag310")
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Reviewed-by: Mete Durlu <meted@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/kernel/diag/diag310.c