Skip to contentSkip to conversation

alpha: fix PR_GET_UNALIGN flag mask

PATCH In review Magnus Lindholm 2 participants 3 messages Oct 25 Alpha port

lore
Share & tools
lore

Magnus Lindholm

author maintainer
#0 lore raw

PATCH 1/1 alpha: fix PR_GET_UNALIGN flag mask

GET_UNALIGN_CTL clears the flags it needs to read, so PR_GET_UNALIGN always returns zero. Keep the UAC bits when translating them to prctl flags.

This was uncovered while running the strace test suite on Alpha.

Fixes 3185bd261882 ("alpha: separate thread-synchronous flags")

---
Tested on UP2000+ (SMP). A standalone regression probe verifies flag round-trips, EFAULT handling and fork isolation. The probe and unchanged strace prctl-unalign test fail before the fix and pass afterwards.

 arch/alpha/include/asm/thread_info.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/alpha/include/asm/thread_info.h +1 -1
index d781ac79106d..22c07ce0a77a 100644
@@ -110,7 +110,7 @@ register unsigned long *current_stack_pointer __asm__ ("$30");
 	0; })
 
 #define GET_UNALIGN_CTL(task,value)	({				\
-	__u32 status = task_thread_info(task)->status & ~UAC_BITMASK;	\
+	__u32 status = task_thread_info(task)->status & UAC_BITMASK;	\
 	__u32 res = 0;							\
 	if (status & TS_UAC_NOPRINT)					\
 		res |= PR_UNALIGN_NOPRINT;				\

base-commit: 71cf9644bcb35e686c3e12a703325335a0925946

Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Magnus Lindholm

GET_UNALIGN_CTL clears the flags it needs to read, so PR_GET_UNALIGN always returns zero. Keep the UAC bits when translating them to prctl flags.

This was uncovered while running the strace test suite on Alpha.

Fixes 3185bd261882 ("alpha: separate thread-synchronous flags")

This has been broken since v3.7, so please add

author maintainer
#2 lore raw

Hi Matt,

Quoted 8 lines · Matt Turner
Quoted 6 lines · Magnus Lindholm

GET_UNALIGN_CTL clears the flags it needs to read, so PR_GET_UNALIGN always returns zero. Keep the UAC bits when translating them to prctl flags.

This was uncovered while running the strace test suite on Alpha.

Quoted 8 lines
Quoted 2 lines
Fixes 3185bd261882 ("alpha: separate thread-synchronous flags")

This has been broken since v3.7, so please add

Will do, thanks for the review.

Magnus