]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
s390/stackleak: Fix __stackleak_poison() inline assembly constraint
authorHeiko Carstens <hca@linux.ibm.com>
Mon, 2 Mar 2026 13:35:00 +0000 (14:35 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 3 Mar 2026 15:42:14 +0000 (16:42 +0100)
commit674c5ff0f440a051ebf299d29a4c013133d81a65
treed6a69a5d5f5ffe796d7c52ca0d91d8e9284f7e4f
parent87ff6da3001b2a35d241c5d965b82536f6418277
s390/stackleak: Fix __stackleak_poison() inline assembly constraint

The __stackleak_poison() inline assembly comes with a "count" operand where
the "d" constraint is used. "count" is used with the exrl instruction and
"d" means that the compiler may allocate any register from 0 to 15.

If the compiler would allocate register 0 then the exrl instruction would
not or the value of "count" into the executed instruction - resulting in a
stackframe which is only partially poisoned.

Use the correct "a" constraint, which excludes register 0 from register
allocation.

Fixes: 2a405f6bb3a5 ("s390/stackleak: provide fast __stackleak_poison() implementation")
Cc: stable@vger.kernel.org
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Reviewed-by: Vasily Gorbik <gor@linux.ibm.com>
Link: https://lore.kernel.org/r/20260302133500.1560531-4-hca@linux.ibm.com
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/include/asm/processor.h