Skip to content

Commit eb56929

Browse files
Sven SchnelleUlrich Hecht
authored andcommitted
parisc: entry: set W bit for !compat tasks in syscall_restore_rfi()
commit 5fb1d3ce3e74a4530042795e1e065422295f1371 upstream. When the kernel leaves to userspace via syscall_restore_rfi(), the W bit is not set in the new PSW. This doesn't cause any problems because there's no 64 bit userspace for parisc. Simple static binaries are usually loaded at addresses way below the 32 bit limit so the W bit doesn't matter. Fix this by setting the W bit when TIF_32BIT is not set. Signed-off-by: Sven Schnelle <svens@stackframe.org> Cc: stable@vger.kernel.org Signed-off-by: Helge Deller <deller@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Ulrich Hecht <uli@kernel.org>
1 parent 0394c0a commit eb56929

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

arch/parisc/kernel/asm-offsets.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@ int main(void)
275275
BLANK();
276276
DEFINE(TIF_BLOCKSTEP_PA_BIT, 31-TIF_BLOCKSTEP);
277277
DEFINE(TIF_SINGLESTEP_PA_BIT, 31-TIF_SINGLESTEP);
278+
DEFINE(TIF_32BIT_PA_BIT, 31-TIF_32BIT);
279+
278280
BLANK();
279281
DEFINE(ASM_PMD_SHIFT, PMD_SHIFT);
280282
DEFINE(ASM_PGDIR_SHIFT, PGDIR_SHIFT);

arch/parisc/kernel/entry.S

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1930,6 +1930,10 @@ syscall_restore_rfi:
19301930
extru,= %r19,TIF_BLOCKSTEP_PA_BIT,1,%r0
19311931
depi -1,7,1,%r20 /* T bit */
19321932

1933+
#ifdef CONFIG_64BIT
1934+
extru,<> %r19,TIF_32BIT_PA_BIT,1,%r0
1935+
depi -1,4,1,%r20 /* W bit */
1936+
#endif
19331937
STREG %r20,TASK_PT_PSW(%r1)
19341938

19351939
/* Always store space registers, since sr3 can be changed (e.g. fork) */
@@ -1943,7 +1947,6 @@ syscall_restore_rfi:
19431947
STREG %r25,TASK_PT_IASQ0(%r1)
19441948
STREG %r25,TASK_PT_IASQ1(%r1)
19451949

1946-
/* XXX W bit??? */
19471950
/* Now if old D bit is clear, it means we didn't save all registers
19481951
* on syscall entry, so do that now. This only happens on TRACEME
19491952
* calls, or if someone attached to us while we were on a syscall.

0 commit comments

Comments
 (0)