Skip to content

Commit 674c5ff

Browse files
hcahcaVasily Gorbik
authored andcommitted
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: 2a405f6 ("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>
1 parent 87ff6da commit 674c5ff

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/s390/include/asm/processor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ static __always_inline void __stackleak_poison(unsigned long erase_low,
159159
" j 4f\n"
160160
"3: mvc 8(1,%[addr]),0(%[addr])\n"
161161
"4:"
162-
: [addr] "+&a" (erase_low), [count] "+&d" (count), [tmp] "=&a" (tmp)
162+
: [addr] "+&a" (erase_low), [count] "+&a" (count), [tmp] "=&a" (tmp)
163163
: [poison] "d" (poison)
164164
: "memory", "cc"
165165
);

0 commit comments

Comments
 (0)