From owner-svn-src-stable@FreeBSD.ORG Fri Sep 24 19:13:43 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEF4F106566C; Fri, 24 Sep 2010 19:13:43 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BDB628FC20; Fri, 24 Sep 2010 19:13:43 +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 o8OJDhMw036435; Fri, 24 Sep 2010 19:13:43 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8OJDhkm036433; Fri, 24 Sep 2010 19:13:43 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201009241913.o8OJDhkm036433@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 24 Sep 2010 19:13:43 +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: r213122 - stable/8/sys/dev/ed X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 19:13:43 -0000 Author: yongari Date: Fri Sep 24 19:13:43 2010 New Revision: 213122 URL: http://svn.freebsd.org/changeset/base/213122 Log: MFC r211721: Fix a possible unaligned access to savebyte array. PR: kern/122195 Modified: stable/8/sys/dev/ed/if_ed.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ed/if_ed.c ============================================================================== --- stable/8/sys/dev/ed/if_ed.c Fri Sep 24 19:11:22 2010 (r213121) +++ stable/8/sys/dev/ed/if_ed.c Fri Sep 24 19:13:43 2010 (r213122) @@ -1462,9 +1462,12 @@ ed_pio_write_mbufs(struct ed_softc *sc, } } else { /* NE2000s are a pain */ - unsigned char *data; + uint8_t *data; int len, wantbyte; - unsigned char savebyte[2]; + union { + uint16_t w; + uint8_t b[2]; + } saveword; wantbyte = 0; @@ -1474,9 +1477,9 @@ ed_pio_write_mbufs(struct ed_softc *sc, data = mtod(m, caddr_t); /* finish the last word */ if (wantbyte) { - savebyte[1] = *data; + saveword.b[1] = *data; ed_asic_outw(sc, ED_NOVELL_DATA, - *(u_short *)savebyte); + saveword.w); data++; len--; wantbyte = 0; @@ -1490,7 +1493,7 @@ ed_pio_write_mbufs(struct ed_softc *sc, } /* save last byte, if necessary */ if (len == 1) { - savebyte[0] = *data; + saveword.b[0] = *data; wantbyte = 1; } } @@ -1498,7 +1501,7 @@ ed_pio_write_mbufs(struct ed_softc *sc, } /* spit last byte */ if (wantbyte) - ed_asic_outw(sc, ED_NOVELL_DATA, *(u_short *)savebyte); + ed_asic_outw(sc, ED_NOVELL_DATA, saveword.w); } /*