Skip to content

Commit 3f0c178

Browse files
committed
parisc: Replace hardcoded value with PRIV_USER constant in ptrace.c
Prefer usage of the PRIV_USER constant over the hard-coded value to set the lowest 2 bits for the userspace privilege. Signed-off-by: Helge Deller <[email protected]> Cc: [email protected] # 5.16+
1 parent 5d1335d commit 3f0c178

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/parisc/kernel/ptrace.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ long arch_ptrace(struct task_struct *child, long request,
166166
addr >= sizeof(struct pt_regs))
167167
break;
168168
if (addr == PT_IAOQ0 || addr == PT_IAOQ1) {
169-
data |= 3; /* ensure userspace privilege */
169+
data |= PRIV_USER; /* ensure userspace privilege */
170170
}
171171
if ((addr >= PT_GR1 && addr <= PT_GR31) ||
172172
addr == PT_IAOQ0 || addr == PT_IAOQ1 ||
@@ -285,7 +285,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
285285
if (addr >= sizeof(struct pt_regs))
286286
break;
287287
if (addr == PT_IAOQ0+4 || addr == PT_IAOQ1+4) {
288-
data |= 3; /* ensure userspace privilege */
288+
data |= PRIV_USER; /* ensure userspace privilege */
289289
}
290290
if (addr >= PT_FR0 && addr <= PT_FR31 + 4) {
291291
/* Special case, fp regs are 64 bits anyway */
@@ -484,7 +484,7 @@ static void set_reg(struct pt_regs *regs, int num, unsigned long val)
484484
case RI(iaoq[0]):
485485
case RI(iaoq[1]):
486486
/* set 2 lowest bits to ensure userspace privilege: */
487-
regs->iaoq[num - RI(iaoq[0])] = val | 3;
487+
regs->iaoq[num - RI(iaoq[0])] = val | PRIV_USER;
488488
return;
489489
case RI(sar): regs->sar = val;
490490
return;

0 commit comments

Comments
 (0)