From owner-svn-src-head@FreeBSD.ORG Sat Nov 14 18:14:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1075106566B; Sat, 14 Nov 2009 18:14:07 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A02EF8FC12; Sat, 14 Nov 2009 18:14:07 +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 nAEIE7bg008532; Sat, 14 Nov 2009 18:14:07 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAEIE7ku008530; Sat, 14 Nov 2009 18:14:07 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200911141814.nAEIE7ku008530@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 14 Nov 2009 18:14:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199274 - head/sys/nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2009 18:14:07 -0000 Author: marcel Date: Sat Nov 14 18:14:07 2009 New Revision: 199274 URL: http://svn.freebsd.org/changeset/base/199274 Log: Fix an obvious panic by not casting from a pointer that is 4-bytes alignment to a type that needs 8-byte alignment, and thus causing misaligned memory references. MFC after: 1 week Modified: head/sys/nfsserver/nfs_fha.c Modified: head/sys/nfsserver/nfs_fha.c ============================================================================== --- head/sys/nfsserver/nfs_fha.c Sat Nov 14 16:20:07 2009 (r199273) +++ head/sys/nfsserver/nfs_fha.c Sat Nov 14 18:14:07 2009 (r199274) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -206,7 +207,11 @@ fha_extract_info(struct svc_req *req, st if (error) goto out; - i->fh = *(const u_int64_t *)(fh.fh_generic.fh_fid.fid_data); +#if _BYTE_ORDER == _LITTLE_ENDIAN + i->fh = le64dec(fh.fh_generic.fh_fid.fid_data); +#else + i->fh = be64dec(fh.fh_generic.fh_fid.fid_data); +#endif /* Content ourselves with zero offset for all but reads. */ if (procnum != NFSPROC_READ)