From owner-svn-src-all@FreeBSD.ORG Thu Sep 24 21:35:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3044A106568F; Thu, 24 Sep 2009 21:35:14 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE11D8FC14; Thu, 24 Sep 2009 21:35:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8OLZDQf008258; Thu, 24 Sep 2009 21:35:13 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8OLZDnY008256; Thu, 24 Sep 2009 21:35:13 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <200909242135.n8OLZDnY008256@svn.freebsd.org> From: Brooks Davis Date: Thu, 24 Sep 2009 21:35:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197474 - stable/8/lib/libkvm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 21:35:14 -0000 Author: brooks Date: Thu Sep 24 21:35:13 2009 New Revision: 197474 URL: http://svn.freebsd.org/changeset/base/197474 Log: MFC r196990: 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 Approved by: re@ (kib) Modified: stable/8/lib/libkvm/ (props changed) stable/8/lib/libkvm/kvm_proc.c Modified: stable/8/lib/libkvm/kvm_proc.c ============================================================================== --- stable/8/lib/libkvm/kvm_proc.c Thu Sep 24 21:32:56 2009 (r197473) +++ stable/8/lib/libkvm/kvm_proc.c Thu Sep 24 21:35:13 2009 (r197474) @@ -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) {