From owner-freebsd-pf@FreeBSD.ORG Wed Jun 15 20:42:32 2005 Return-Path: X-Original-To: freebsd-pf@freebsd.org Delivered-To: freebsd-pf@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 23F8116A41C; Wed, 15 Jun 2005 20:42:32 +0000 (GMT) (envelope-from dhartmei@insomnia.benzedrine.cx) Received: from insomnia.benzedrine.cx (insomnia.benzedrine.cx [62.65.145.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id 89B4543D49; Wed, 15 Jun 2005 20:42:31 +0000 (GMT) (envelope-from dhartmei@insomnia.benzedrine.cx) Received: from insomnia.benzedrine.cx (dhartmei@localhost [127.0.0.1]) by insomnia.benzedrine.cx (8.13.3/8.12.11) with ESMTP id j5FKgWOm009630 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO); Wed, 15 Jun 2005 22:42:32 +0200 (MEST) Received: (from dhartmei@localhost) by insomnia.benzedrine.cx (8.13.4/8.12.10/Submit) id j5FKgWNA032731; Wed, 15 Jun 2005 22:42:32 +0200 (MEST) Date: Wed, 15 Jun 2005 22:42:32 +0200 From: Daniel Hartmeier To: Marcel Moolenaar Message-ID: <20050615204232.GX8526@insomnia.benzedrine.cx> References: <200506132123.j5DLNove069255@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200506132123.j5DLNove069255@freefall.freebsd.org> User-Agent: Mutt/1.5.6i Cc: freebsd-net@freebsd.org, freebsd-pf@freebsd.org Subject: Re: ia64/81284: Unaligned Reference with pf on 5.4/IA64 X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2005 20:42:32 -0000 On Mon, Jun 13, 2005 at 09:23:50PM +0000, Marcel Moolenaar wrote: > Synopsis: Unaligned Reference with pf on 5.4/IA64 > > Responsible-Changed-From-To: freebsd-net->freebsd-pf > Responsible-Changed-By: marcel > Responsible-Changed-When: Mon Jun 13 21:22:54 GMT 2005 > Responsible-Changed-Why: > Move to a more pf-focussed responsible party. > > http://www.freebsd.org/cgi/query-pr.cgi?pr=81284 If I understand the problem correctly, there is an underlying network-generic question I'd like to ask here. When a function in the kernel gets passed a struct ip pointer, can it assume that the struct ip object pointed to is properly aligned? Or should it assume that this is not the case, and extract members more carefully? We can fix the access in pf of course, but if other functions rightfully count on struct ip objects being properly aligned, this might simply crash outside of pf, too. In short, is the problem that bridge doesn't properly align the struct ip object (which I can try to fix, too), or that pf assumes that such objects should be aligned? On OpenBSD's 64-bit architectures with varying alignment rules, this has never occured, I think because the struct ip objects (and, hence, their ip_src/dst members) are kept aligned. If I'm way off, and proper alignment of struct ip objects does not guarantee proper alignment of the ip_src/dst members as 32-bit unsigneds, please explain. If ia64 is different from other 64-bit architectures (of which I only know amd64, sparc64 and alpha), please explain what alignment rules there are for u_int32_t. Daniel