Skip to content

Commit

Permalink
parisc: Correct completer in lws start
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
danglin44 authored and hdeller committed Dec 21, 2021
1 parent 484730e commit 8f66fce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/parisc/kernel/syscall.S
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ lws_start:
extrd,u %r1,PSW_W_BIT,1,%r1
/* sp must be aligned on 4, so deposit the W bit setting into
* the bottom of sp temporarily */
or,ev %r1,%r30,%r30
or,od %r1,%r30,%r30

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

0 comments on commit 8f66fce

Please sign in to comment.