From owner-svn-src-head@freebsd.org Sun Jul 29 18:22:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECE51105D19A; Sun, 29 Jul 2018 18:22:26 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A1ED18A45F; Sun, 29 Jul 2018 18:22:26 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8316619568; Sun, 29 Jul 2018 18:22:26 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6TIMQcV010727; Sun, 29 Jul 2018 18:22:26 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6TIMQhG010726; Sun, 29 Jul 2018 18:22:26 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201807291822.w6TIMQhG010726@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 29 Jul 2018 18:22:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336871 - head/sys/compat/freebsd32 X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/compat/freebsd32 X-SVN-Commit-Revision: 336871 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jul 2018 18:22:27 -0000 Author: asomers Date: Sun Jul 29 18:22:26 2018 New Revision: 336871 URL: https://svnweb.freebsd.org/changeset/base/336871 Log: getrusage(2): fix return value under 32-bit emulation According to the man page, getrusage(2) should return EFAULT if the rusage argument lies outside of the process's address space. But due to an oversight in r100384, that's never been the case during 32-bit emulation. Fix it. PR: 230153 Reported by: tests(7) Reviewed by: cem MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16500 Modified: head/sys/compat/freebsd32/freebsd32_misc.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Sun Jul 29 17:27:10 2018 (r336870) +++ head/sys/compat/freebsd32/freebsd32_misc.c Sun Jul 29 18:22:26 2018 (r336871) @@ -883,12 +883,9 @@ freebsd32_getrusage(struct thread *td, struct freebsd3 int error; error = kern_getrusage(td, uap->who, &s); - if (error) - return (error); - if (uap->rusage != NULL) { - freebsd32_rusage_out(&s, &s32); + freebsd32_rusage_out(&s, &s32); + if (error == 0) error = copyout(&s32, uap->rusage, sizeof(s32)); - } return (error); }