Skip to content

Commit

Permalink
rseq: Remove redundant access_ok()
Browse files Browse the repository at this point in the history
After commit 8f28177 ("rseq: Use get_user/put_user rather
than __get_user/__put_user") we no longer need
an access_ok() call from __rseq_handle_notify_resume()

Mathieu pointed out the same cleanup can be done
in rseq_syscall().

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://lkml.kernel.org/r/20210413203352.71350-3-eric.dumazet@gmail.com
  • Loading branch information
Eric Dumazet authored and Peter Zijlstra committed Apr 14, 2021
1 parent 60af388 commit 0ed9605
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions kernel/rseq.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,6 @@ void __rseq_handle_notify_resume(struct ksignal *ksig, struct pt_regs *regs)

if (unlikely(t->flags & PF_EXITING))
return;
if (unlikely(!access_ok(t->rseq, sizeof(*t->rseq))))
goto error;
ret = rseq_ip_fixup(regs);
if (unlikely(ret < 0))
goto error;
Expand All @@ -301,8 +299,7 @@ void rseq_syscall(struct pt_regs *regs)

if (!t->rseq)
return;
if (!access_ok(t->rseq, sizeof(*t->rseq)) ||
rseq_get_rseq_cs(t, &rseq_cs) || in_rseq_cs(ip, &rseq_cs))
if (rseq_get_rseq_cs(t, &rseq_cs) || in_rseq_cs(ip, &rseq_cs))
force_sig(SIGSEGV);
}

Expand Down

0 comments on commit 0ed9605

Please sign in to comment.