Mercurial > illumos > illumos-gate
changeset 10739:01d875748398
6874413 ::pfiles dereferences data it doesn't copy in
author | Dan Price <dp@eng.sun.com> |
---|---|
date | Wed, 07 Oct 2009 17:26:56 -0700 |
parents | 6cd5e5169fec |
children | b13b4915cb81 |
files | usr/src/cmd/mdb/common/modules/genunix/vfs.c |
diffstat | 1 files changed, 10 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/cmd/mdb/common/modules/genunix/vfs.c Wed Oct 07 16:55:54 2009 -0700 +++ b/usr/src/cmd/mdb/common/modules/genunix/vfs.c Wed Oct 07 17:26:56 2009 -0700 @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -485,13 +485,20 @@ */ if (v.v_type == VSOCK) { struct sonode sonode; + struct sockparams sockparams; if (pfiles_get_sonode(&v, &sonode) == -1) { return (-1); } + if (mdb_vread(&sockparams, sizeof (sockparams), + (uintptr_t)sonode.so_sockparams) == -1) { + mdb_warn("failed to read sockparams"); + return (-1); + } + if (!SOCK_IS_NONSTR(&sonode)) { - struct sockparams *sp = sonode.so_sockparams; - vp = (uintptr_t)sp->sp_sdev_info.sd_vnode; + vp = (uintptr_t) + sockparams.sp_sdev_info.sd_vnode; } else { vp = NULL; }