]> git.ipfire.org Git - people/ms/linux.git/commit - kernel/seccomp.c
seccomp: Use current_pt_regs() instead of task_pt_regs(current)
authorDenis Efremov <efremov@linux.com>
Mon, 24 Aug 2020 12:59:21 +0000 (15:59 +0300)
committerKees Cook <keescook@chromium.org>
Tue, 8 Sep 2020 23:26:45 +0000 (16:26 -0700)
commit2d9ca267a944c2b6ed5b4d750b1cf0407b6262b4
tree518d63cc6743f1151994332b3a8f1396ee785bd9
parent3932fcecd96221e18100055d623b736d0ff873a4
seccomp: Use current_pt_regs() instead of task_pt_regs(current)

As described in commit a3460a59747c ("new helper: current_pt_regs()"):
- arch versions are "optimized versions".
- some architectures have task_pt_regs() working only for traced tasks
  blocked on signal delivery. current_pt_regs() needs to work for *all*
  processes.

In preparation for adding a coccinelle rule for using current_*(), instead
of raw accesses to current members, modify seccomp_do_user_notification(),
__seccomp_filter(), __secure_computing() to use current_pt_regs().

Signed-off-by: Denis Efremov <efremov@linux.com>
Link: https://lore.kernel.org/r/20200824125921.488311-1-efremov@linux.com
[kees: Reworded commit log, add comment to populate_seccomp_data()]
Signed-off-by: Kees Cook <keescook@chromium.org>
kernel/seccomp.c