Skip to contentSkip to conversation

FAILED: patch "[PATCH] s390/stackleak: Fix __stackleak_poison() inline assembly" failed to apply to 6.12-stable tree

PATCH New [email protected] 2 participants 2 messages Mar 17 – Mar 18

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 6.12-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y
git checkout FETCH_HEAD
git cherry-pick -x 674c5ff0f440a051ebf299d29a4c013133d81a65
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026031738-blob-labored-5201@gregkh' --subject-prefix 'PATCH 6.12.y' HEAD^..

Possible dependencies:

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 674c5ff0f440a051ebf299d29a4c013133d81a65 Mon Sep 17 00:00:00 2001
From: Heiko Carstens <[email protected]>
Date: Mon, 2 Mar 2026 14:35:00 +0100
Subject: [PATCH] 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")
arch/s390/include/asm/processor.h +1 -1
index cc187afa07b3..78195ee5e99f 100644
@@ -159,7 +159,7 @@ static __always_inline void __stackleak_poison(unsigned long erase_low,
 		"	j	4f\n"
 		"3:	mvc	8(1,%[addr]),0(%[addr])\n"
 		"4:"
-		: [addr] "+&a" (erase_low), [count] "+&d" (count), [tmp] "=&a" (tmp)
+		: [addr] "+&a" (erase_low), [count] "+&a" (count), [tmp] "=&a" (tmp)
 		: [poison] "d" (poison)
 		: "memory", "cc"
 		);
maintainer
#1 lore raw

PATCH 1/1 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")
(cherry picked from commit 674c5ff0f440a051ebf299d29a4c013133d81a65)
---
 arch/s390/include/asm/processor.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/include/asm/processor.h +1 -1
index 21ae93cbd8e4..ef622c3f88e5 100644
@@ -168,7 +168,7 @@ static __always_inline void __stackleak_poison(unsigned long erase_low,
 		"	j	4f\n"
 		"3:	mvc	8(1,%[addr]),0(%[addr])\n"
 		"4:\n"
-		: [addr] "+&a" (erase_low), [count] "+&d" (count), [tmp] "=&a" (tmp)
+		: [addr] "+&a" (erase_low), [count] "+&a" (count), [tmp] "=&a" (tmp)
 		: [poison] "d" (poison)
 		: "memory", "cc"
 		);
Signature · 1 line
2.51.0