From owner-freebsd-pf@freebsd.org Sat Jan 30 22:14:24 2016 Return-Path: Delivered-To: freebsd-pf@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0783A73B7B for ; Sat, 30 Jan 2016 22:14:24 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4CECEB7 for ; Sat, 30 Jan 2016 22:14:24 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Sat, 30 Jan 2016 22:15:20 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u0UMEG21002051; Sat, 30 Jan 2016 15:14:16 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1454192055.32550.8.camel@freebsd.org> Subject: Re: [Bug 206658] Bus error for pfctl -sa on rpi2 r294499 snap From: Ian Lepore To: peter garshtja , Jov Cc: freebsd-arm , "freebsd-pf@freebsd.org" Date: Sat, 30 Jan 2016 15:14:15 -0700 In-Reply-To: References: <1453862939.42081.25.camel@freebsd.org> <1453867724.42081.28.camel@freebsd.org> <1453903433.42081.30.camel@freebsd.org> Content-Type: text/plain; charset="iso-2022-jp" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.20 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: Sat, 30 Jan 2016 22:14:25 -0000 FYI, I've committed r295086, which is conceptually the patch submitted by Guy Yur, but restructured with an #ifndef __NO_STRICT_ALIGNMENT wrapper, and in general more like the corresponding code on the kernel side for handling this. Could somebody who uses pf please give this a test and let me know if it works right? (It *looks* right, but... you know.) If it works I should get it MFC'd before the 10.3 release. -- Ian On Fri, 2016-01-29 at 00:11 -0500, peter garshtja wrote: > Much appreciated for your effort. > > I have been waiting for this fix over 3months. > > Regards > > On Thursday, January 28, 2016, Jov wrote: > > > This patch works,thanks very much ! > > > > will these patches to be commited to the offical svn? I add freebsd > > -pf ML. > > > > > > Jov > > blog: http:amutu.com/blog > > > > 2016-01-29 5:26 GMT+08:00 Guy Yur > > > : > > > > > Hi, > > > > > > On Thu, Jan 28, 2016 at 2:06 PM, Jov > > :;>> > > wrote: > > > > bus error at the similar position: > > > > > > > > Program received signal SIGBUS, Bus error. > > > > 0x00021614 in print_host (addr=0x2065111a, port=15268, af=2 > > > > '\002', > > > > opts=1024) at /usr/src/sbin/pfctl/pf_print_state.c:178 > > > > warning: Source file is more recent than executable. > > > > > > > > 178 memcpy(&aw.v.a.addr, addr, sizeof(aw.v.a.addr)); > > > > Current language: auto; currently minimal > > > > (gdb) p addr > > > > $1 = (struct pf_addr *) 0x2065111a > > > > ... > > > > > > > > Jov > > > > > > The compiler optimizes the memcpy to a series of ldr and str > > > instructions and since addr is unaligned you still get SIGBUS. > > > > > > I encountered the same problem on a BeagleBone Black. > > > https://lists.freebsd.org/pipermail/freebsd-arm/2014-January/0072 > > > 37.html > > > > > > non-intrustive patch with changes only in print_state() > > > pfsync_state is __packed so the keys can be copied safely to > > > stack variables which will be aligned (and addr inside it). > > > > > > > > https://github.com/guyyur/freebsd-src_patches/blob/master/pfctl_arm > > _segbus__ver1_part1.patch > > > > > > Bug report with patch to separate pfsync and pfioc state > > > structures but breaks backward compatibility: > > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=185617 > > > > > > -- Guy > > > > > _______________________________________________ > > freebsd-arm@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-arm > > To unsubscribe, send any mail to " > > freebsd-arm-unsubscribe@freebsd.org > > " > _______________________________________________ > freebsd-arm@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-arm > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org > " >