Skip to content

Commit 5fb1d3c

Browse files
Sven Schnellehdeller
authored andcommitted
parisc: entry: set W bit for !compat tasks in syscall_restore_rfi()
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>
1 parent 3631b9c commit 5fb1d3c

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
@@ -258,6 +258,8 @@ int main(void)
258258
BLANK();
259259
DEFINE(TIF_BLOCKSTEP_PA_BIT, 31-TIF_BLOCKSTEP);
260260
DEFINE(TIF_SINGLESTEP_PA_BIT, 31-TIF_SINGLESTEP);
261+
DEFINE(TIF_32BIT_PA_BIT, 31-TIF_32BIT);
262+
261263
BLANK();
262264
DEFINE(ASM_PMD_SHIFT, PMD_SHIFT);
263265
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
@@ -1841,6 +1841,10 @@ syscall_restore_rfi:
18411841
extru,= %r19,TIF_BLOCKSTEP_PA_BIT,1,%r0
18421842
depi -1,7,1,%r20 /* T bit */
18431843

1844+
#ifdef CONFIG_64BIT
1845+
extru,<> %r19,TIF_32BIT_PA_BIT,1,%r0
1846+
depi -1,4,1,%r20 /* W bit */
1847+
#endif
18441848
STREG %r20,TASK_PT_PSW(%r1)
18451849

18461850
/* Always store space registers, since sr3 can be changed (e.g. fork) */
@@ -1854,7 +1858,6 @@ syscall_restore_rfi:
18541858
STREG %r25,TASK_PT_IASQ0(%r1)
18551859
STREG %r25,TASK_PT_IASQ1(%r1)
18561860

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

0 commit comments

Comments
 (0)