Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Aug 2009 02:21:24 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r196271 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris cddl/contrib/opensolaris/common/nvpair contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/xen/netfront dev/xen/xe...
Message-ID:  <200908160221.n7G2LOE2097585@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Sun Aug 16 02:21:24 2009
New Revision: 196271
URL: http://svn.freebsd.org/changeset/base/196271

Log:
  MFC revision 196269:
  Fix misalignment in nvpair_native_embedded() caused by the compiler
  replacing the bzero().
  
  Approved by:	re (kensmith)

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/ata/   (props changed)
  stable/8/sys/dev/cxgb/   (props changed)
  stable/8/sys/dev/xen/netfront/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/modules/dtrace/dtnfsclient/   (props changed)
  stable/8/sys/modules/ip6_mroute_mod/   (props changed)
  stable/8/sys/modules/ipmi/ipmi_linux/   (props changed)
  stable/8/sys/netinet/ipfw/ip_dummynet.c   (props changed)
  stable/8/sys/netinet/ipfw/ip_fw2.c   (props changed)
  stable/8/sys/netinet/ipfw/ip_fw_nat.c   (props changed)
  stable/8/sys/netinet/ipfw/ip_fw_pfil.c   (props changed)
  stable/8/sys/netipx/spx_reass.c   (props changed)
  stable/8/sys/xen/evtchn.h   (props changed)
  stable/8/sys/xen/hypervisor.h   (props changed)
  stable/8/sys/xen/xen_intr.h   (props changed)

Modified: stable/8/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c	Sun Aug 16 02:12:13 2009	(r196270)
+++ stable/8/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c	Sun Aug 16 02:21:24 2009	(r196271)
@@ -2523,14 +2523,15 @@ nvpair_native_embedded(nvstream_t *nvs, 
 {
 	if (nvs->nvs_op == NVS_OP_ENCODE) {
 		nvs_native_t *native = (nvs_native_t *)nvs->nvs_private;
-		nvlist_t *packed = (void *)
+		char *packed = (void *)
 		    (native->n_curr - nvp->nvp_size + NVP_VALOFF(nvp));
 		/*
 		 * Null out the pointer that is meaningless in the packed
 		 * structure. The address may not be aligned, so we have
 		 * to use bzero.
 		 */
-		bzero(&packed->nvl_priv, sizeof (packed->nvl_priv));
+		bzero(packed + offsetof(nvlist_t, nvl_priv),
+		    sizeof(((nvlist_t *)NULL)->nvl_priv));
 	}
 
 	return (nvs_embedded(nvs, EMBEDDED_NVL(nvp)));



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