svn commit: r196990 - head/lib/libkvm

Brooks Davis brooks at FreeBSD.org
Tue Sep 8 19:38:00 UTC 2009


Author: brooks
Date: Tue Sep  8 19:37:59 2009
New Revision: 196990
URL: http://svn.freebsd.org/changeset/base/196990

Log:
  cr_groups is no longer embedded in struct ucred and is instead stored
  in a seperate array.  As such we need to use kvm_read rather than bcopy
  to populate the ki_groups field.
  
  This fixes a crash when running ps -ax on a coredump.
  
  Reported by:	brucec
  Tested by:	brucec
  MFC after:	3 days

Modified:
  head/lib/libkvm/kvm_proc.c

Modified: head/lib/libkvm/kvm_proc.c
==============================================================================
--- head/lib/libkvm/kvm_proc.c	Tue Sep  8 19:18:02 2009	(r196989)
+++ head/lib/libkvm/kvm_proc.c	Tue Sep  8 19:37:59 2009	(r196990)
@@ -151,7 +151,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcn
 				kp->ki_cr_flags |= KI_CRF_GRP_OVERFLOW;
 			}
 				kp->ki_ngroups = ucred.cr_ngroups;
-			bcopy(ucred.cr_groups, kp->ki_groups,
+			kvm_read(kd, (u_long)ucred.cr_groups, kp->ki_groups,
 			    kp->ki_ngroups * sizeof(gid_t));
 			kp->ki_uid = ucred.cr_uid;
 			if (ucred.cr_prison != NULL) {


More information about the svn-src-head mailing list