Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Oct 2018 16:23:00 +0000 (UTC)
From:      Alan Somers <asomers@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r339065 - stable/10/sys/compat/freebsd32
Message-ID:  <201810011623.w91GN0M9028477@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: asomers
Date: Mon Oct  1 16:23:00 2018
New Revision: 339065
URL: https://svnweb.freebsd.org/changeset/base/339065

Log:
  MFC r336871, r336874
  
  r336871:
  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
  Differential Revision:	https://reviews.freebsd.org/D16500
  
  r336874:
  freebsd32_getrusage(2): skip freebsd32_rusage_out on error
  
  PR:		230153
  Reported by:	kib
  X-MFC-With:	336871
  Differential Revision:	https://reviews.freebsd.org/D16500

Modified:
  stable/10/sys/compat/freebsd32/freebsd32_misc.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- stable/10/sys/compat/freebsd32/freebsd32_misc.c	Mon Oct  1 16:16:05 2018	(r339064)
+++ stable/10/sys/compat/freebsd32/freebsd32_misc.c	Mon Oct  1 16:23:00 2018	(r339065)
@@ -824,9 +824,7 @@ freebsd32_getrusage(struct thread *td, struct freebsd3
 	int error;
 
 	error = kern_getrusage(td, uap->who, &s);
-	if (error)
-		return (error);
-	if (uap->rusage != NULL) {
+	if (error == 0) {
 		freebsd32_rusage_out(&s, &s32);
 		error = copyout(&s32, uap->rusage, sizeof(s32));
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201810011623.w91GN0M9028477>