mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dominik Brodowski <linux@dominikbrodowski.net>
To: linux-kernel@vger.kernel.org, luto@kernel.org,
	torvalds@linux-foundation.org, mingo@kernel.org,
	viro@zeniv.linux.org.uk, akpm@linux-foundation.org
Cc: "Luis R . Rodriguez" <mcgrof@kernel.org>
Subject: [RFC PATCH 02/35] syscalls: use kernel_wait4() instead of sys_wait4()
Date: Sun, 11 Mar 2018 11:55:24 +0100	[thread overview]
Message-ID: <20180311105557.20807-3-linux@dominikbrodowski.net> (raw)
In-Reply-To: <20180311105557.20807-1-linux@dominikbrodowski.net>

All call sites of sys_wait4() set *rusage to NULL. Therefore, there is
no need for the copy_to_user() handling of *rusage, and we can use
kernel_wait4() directly.

CC: Luis R. Rodriguez <mcgrof@kernel.org>
CC: Al Viro <viro@zeniv.linux.org.uk>
CC: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
---
 kernel/exit.c          | 2 +-
 kernel/pid_namespace.c | 6 +++---
 kernel/umh.c           | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/kernel/exit.c b/kernel/exit.c
index 995453d9fb55..c3c7ac560114 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -1691,7 +1691,7 @@ SYSCALL_DEFINE4(wait4, pid_t, upid, int __user *, stat_addr,
  */
 SYSCALL_DEFINE3(waitpid, pid_t, pid, int __user *, stat_addr, int, options)
 {
-	return sys_wait4(pid, stat_addr, options, NULL);
+	return kernel_wait4(pid, stat_addr, options, NULL);
 }
 
 #endif
diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c
index 0b53eef7d34b..93b57f026688 100644
--- a/kernel/pid_namespace.c
+++ b/kernel/pid_namespace.c
@@ -242,16 +242,16 @@ void zap_pid_ns_processes(struct pid_namespace *pid_ns)
 
 	/*
 	 * Reap the EXIT_ZOMBIE children we had before we ignored SIGCHLD.
-	 * sys_wait4() will also block until our children traced from the
+	 * kernel_wait4() will also block until our children traced from the
 	 * parent namespace are detached and become EXIT_DEAD.
 	 */
 	do {
 		clear_thread_flag(TIF_SIGPENDING);
-		rc = sys_wait4(-1, NULL, __WALL, NULL);
+		rc = kernel_wait4(-1, NULL, __WALL, NULL);
 	} while (rc != -ECHILD);
 
 	/*
-	 * sys_wait4() above can't reap the EXIT_DEAD children but we do not
+	 * kernel_wait4() above can't reap the EXIT_DEAD children but we do not
 	 * really care, we could reparent them to the global init. We could
 	 * exit and reap ->child_reaper even if it is not the last thread in
 	 * this pid_ns, free_pid(pid_allocated == 0) calls proc_cleanup_work(),
diff --git a/kernel/umh.c b/kernel/umh.c
index 18e5fa4b0e71..f4b557cadf08 100644
--- a/kernel/umh.c
+++ b/kernel/umh.c
@@ -135,7 +135,7 @@ static void call_usermodehelper_exec_sync(struct subprocess_info *sub_info)
 		 *
 		 * Thus the __user pointer cast is valid here.
 		 */
-		sys_wait4(pid, (int __user *)&ret, 0, NULL);
+		kernel_wait4(pid, (int __user *)&ret, 0, NULL);
 
 		/*
 		 * If ret is 0, either call_usermodehelper_exec_async failed and
-- 
2.16.2

  parent reply	other threads:[~2018-03-11 11:00 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-11 10:55 [RFC PATCH 00/35] remove in-kernel syscall invocations Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 01/35] syscalls: define goal to not call sys_xyzzy() from within the kernel Dominik Brodowski
2018-03-11 15:24   ` Andy Lutomirski
2018-03-12  7:27     ` Ingo Molnar
2018-03-12 19:14     ` Dominik Brodowski
2018-03-11 10:55 ` Dominik Brodowski [this message]
2018-03-12  7:29   ` [RFC PATCH 02/35] syscalls: use kernel_wait4() instead of sys_wait4() Ingo Molnar
2018-03-11 10:55 ` [RFC PATCH 03/35] syscalls: mm_release(): use do_futex() instead of sys_futex() Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 04/35] syscalls: do not call sys_getpgid() within the kernel Dominik Brodowski
2018-03-12  8:35   ` Christoph Hellwig
2018-03-12 20:01     ` Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 05/35] syscalls: do not call sys_readlinkat() " Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 06/35] syscalls: do not call sys_pipe2() " Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 07/35] syscalls: do not call sys_renameat2() " Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 08/35] syscalls: do not call sys_futimesat() " Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 09/35] syscalls: do not call sys_epoll_*() " Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 10/35] syscalls: do not call sys_signalfd4() " Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 11/35] syscalls: do not call sys_eventfd2() " Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 12/35] syscalls: do not call sys_rt_sigpending() " Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 13/35] syscalls: do not call sys_ioperm() " Dominik Brodowski
2018-03-11 15:20   ` Andy Lutomirski
2018-03-15 16:43   ` Greg Kroah-Hartman
2018-03-11 10:55 ` [RFC PATCH 14/35] syscalls: do not call sys_mount() " Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 15/35] syscalls: do not call sys_umount() " Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 16/35] syscalls: do not call sys_dup{,3}() " Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 17/35] syscalls: do not call sys_chroot() " Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 18/35] syscalls: do not call sys_write() " Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 19/35] syscalls: do not call sys_unshare() " Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 20/35] syscalls: do not call sys_fadvise64{,_64}() " Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 21/35] syscalls: do not call sys_mmap_pgoff() " Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 22/35] syscalls: do not call sys_chdir() " Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 23/35] syscalls: do not call sys_sync_file_range() " Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 24/35] syscalls: do not call sys_unlink() " Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 25/35] hostfs: rename do_rmdir() to hostfs_do_rmdir() Dominik Brodowski
2018-03-11 11:19   ` Richard Weinberger
2018-03-11 10:55 ` [RFC PATCH 26/35] syscalls: do not call sys_rmdir() within the kernel Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 27/35] syscalls: do not call sys_mkdir{,at}() " Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 28/35] syscalls: do not call sys_symlink{,at}() " Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 29/35] syscalls: do not call sys_mknod{,at}() " Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 30/35] syscalls: do not call sys_link{,at}() " Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 31/35] syscalls: do not call sys_{f,}chmod{at,}() " Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 32/35] syscalls: do not call sys_{f,}access{,at}() " Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 33/35] syscalls: do not call sys_ftruncate() " Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 34/35] syscalls: do not call sys_{,l,f}chown() " Dominik Brodowski
2018-03-11 10:55 ` [RFC PATCH 35/35] syscalls: do not call sys_close() " Dominik Brodowski
2018-03-12  7:37   ` Ingo Molnar
2018-03-12 19:43     ` Dominik Brodowski
2018-03-13  5:46       ` Ingo Molnar
2018-03-11 20:15 ` [RFC PATCH 00/35] remove in-kernel syscall invocations Linus Torvalds
2018-03-12 21:39   ` Dominik Brodowski
2018-03-12  7:32 ` Ingo Molnar
2018-03-12 19:30   ` Dominik Brodowski
2018-03-13  5:48     ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180311105557.20807-3-linux@dominikbrodowski.net \
    --to=linux@dominikbrodowski.net \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=mingo@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®