Skip to content

Commit 8f66fce

Browse files
danglin44hdeller
authored andcommitted
parisc: Correct completer in lws start
The completer in the "or,ev %r1,%r30,%r30" instruction is reversed, so we are not clipping the LWS number when we are called from a 32-bit process (W=0). We need to nulify the following depdi instruction when the least-significant bit of %r30 is 1. If the %r20 register is not clipped, a user process could perform a LWS call that would branch to an undefined location in the kernel and potentially crash the machine. Signed-off-by: John David Anglin <[email protected]> Cc: [email protected] # 4.19+ Signed-off-by: Helge Deller <[email protected]>
1 parent 484730e commit 8f66fce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/parisc/kernel/syscall.S

+1-1
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ lws_start:
472472
extrd,u %r1,PSW_W_BIT,1,%r1
473473
/* sp must be aligned on 4, so deposit the W bit setting into
474474
* the bottom of sp temporarily */
475-
or,ev %r1,%r30,%r30
475+
or,od %r1,%r30,%r30
476476

477477
/* Clip LWS number to a 32-bit value for 32-bit processes */
478478
depdi 0, 31, 32, %r20

0 commit comments

Comments
 (0)