Skip to contentSkip to conversation

parisc: Fix ptrace check on syscall return

PATCH New Helge Deller 1 participant 1 message Oct 4, 2021 PA-RISC architecture

lore
Share & tools
lore

Helge Deller

author maintainer
#0 lore raw

PATCH 1/1 parisc: Fix ptrace check on syscall return

**untested**

The TIF_XXX flags are stored in the flags field in the thread_info struct (TI_FLAGS), not in the flags field of the task_struct structure (TASK_FLAGS).

It seems this bug has been in the kernel for 12 years (since v2.6.32).

Fixes ecd3d4bc06e48 ("parisc: stop using task->ptrace for {single,block}step flags")
arch/parisc/kernel/entry.S +1 -1
index f75d7d7efd25..c312aef175df 100644
@@ -1834,7 +1834,7 @@ syscall_restore:
 	LDREG	TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1
 
 	/* Are we being ptraced? */
-	ldw	TASK_FLAGS(%r1),%r19
+	LDREG	TI_FLAGS-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r19
 	ldi	_TIF_SYSCALL_TRACE_MASK,%r2
 	and,COND(=)	%r19,%r2,%r0
 	b,n	syscall_restore_rfi