Received: by 10.213.65.68 with SMTP id h4csp146678imn; Thu, 15 Mar 2018 12:16:35 -0700 (PDT) X-Google-Smtp-Source: AG47ELsBcBvs4hE695I3ascML+Af+A5I6+sWC7qKwoxCOmvHjAttlh2ytPbYHptir0UcxoZe8PGl X-Received: by 10.98.97.1 with SMTP id v1mr2695873pfb.119.1521141395649; Thu, 15 Mar 2018 12:16:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521141395; cv=none; d=google.com; s=arc-20160816; b=IDQgcHFlvkFlJfKc1WQ1YZUz2JhCfQWMq2/99vswX7LUwWU9eGOS6GmrG+DWKk95pZ R9WvYOqFrs2RrhNPsp74Zu+okj6X4kVRHAzeXng74HVKR8WFj+/mLhLsHNXUZ7sK0PMF ZH4w5UQsrWsq/gIaKnKQKlhqrX+SBL2x8I24jsuC7pBjDEQQaeRQruLviWxCsuite0EC sD+/2Ny6Pta5FllAf17pilSCD4zMCvmVbuuI/rYSeYO7ll/rB0yLbGlNUHKdG6eepRmH 8SUm8t4lvggUWpanVHlQo/LoXVE+hKyPBqXShd4IsYjk7sc2mzHgRPgDcRKfmFSmekHp bm1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=oglvjPb9N/K9Z6z8WlzA3uiEsUBViJB9q0fwcPpOWIo=; b=PLAYoOY5quEJqftckeT9yWu9Xl8R20JkrUlUeBCJrASuq8CjNkj5qAoUNwxJIXJo4r SW+w/FCfraLANgRKteJuSVaN7+mi0RNES06HfhegvRn7yxAWiStaD20nw9/ggZFUfAyJ xhRiPTe4/2fSwM3+dnrwy/PkzPRceb/aadIq3wAcQm0US8cq0SG/GY+rUPImnZPp0ueV xSJ/a1NmWvwEXqfxeS3S3oquxHnuLwRTZ2isVDhV7m+wF1kCNGH3UUG5a+6c42468+RG BlGh1EqC3fld1wJ/fLxPPb6nIwxkC6B1lyWbrvmo/WyLQ+Ui0btIdEUloUyTv2ooxNfu +0Yg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9-v6si4549145pln.89.2018.03.15.12.16.20; Thu, 15 Mar 2018 12:16:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932588AbeCOTGU (ORCPT + 99 others); Thu, 15 Mar 2018 15:06:20 -0400 Received: from isilmar-4.linta.de ([136.243.71.142]:35784 "EHLO isilmar-4.linta.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932475AbeCOTGT (ORCPT ); Thu, 15 Mar 2018 15:06:19 -0400 Received: from light.dominikbrodowski.net (isilmar.linta [10.0.0.1]) by isilmar-4.linta.de (Postfix) with ESMTPS id E4C22200902; Thu, 15 Mar 2018 19:06:17 +0000 (UTC) Received: by light.dominikbrodowski.net (Postfix, from userid 1000) id 656C1201B7; Thu, 15 Mar 2018 20:05:37 +0100 (CET) From: Dominik Brodowski To: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, viro@zeniv.linux.org.uk Cc: luto@kernel.org, mingo@kernel.org, akpm@linux-foundation.org, arnd@arndb.de, "Luis R . Rodriguez" Subject: [PATCH v2 02/36] kernel: use kernel_wait4() instead of sys_wait4() Date: Thu, 15 Mar 2018 20:04:55 +0100 Message-Id: <20180315190529.20943-3-linux@dominikbrodowski.net> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180315190529.20943-1-linux@dominikbrodowski.net> References: <20180315190529.20943-1-linux@dominikbrodowski.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Al Viro Cc: Andrew Morton Signed-off-by: Dominik Brodowski --- 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