From owner-freebsd-arm@freebsd.org Mon Feb 1 02:36:09 2016 Return-Path: Delivered-To: freebsd-arm@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 43A5CA758B4 for ; Mon, 1 Feb 2016 02:36:09 +0000 (UTC) (envelope-from amutu@amutu.com) Received: from mail-yk0-x230.google.com (mail-yk0-x230.google.com [IPv6:2607:f8b0:4002:c07::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED30C37E for ; Mon, 1 Feb 2016 02:36:08 +0000 (UTC) (envelope-from amutu@amutu.com) Received: by mail-yk0-x230.google.com with SMTP id z7so57831163yka.3 for ; Sun, 31 Jan 2016 18:36:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amutu-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=SbtgFS0miCegQcGLuaz5iU5hSbPDEPNQKgVZ0NNtkAM=; b=C+gx8Rh1Hz8kRO0xuxUhi/czaXJ1+hQqozJFVRLQnTS0fOi1fTJd/kIu4TvP7g67h0 D46FQzwItjeix9nNDBOvKWnl46L7GqAGvOHLFoefpMRbAN2vCPPmXd2HhKHrPfK8UkCh URE2Qw7R8fOl9zUt+i0X0S8Y+okwVB9qTI736MrpjVJINjwgE3RY/1tBisyI7a1HdTd8 f8sClzv8KIlKswLteYymiIr+VdAlaoc9DYQPK/kzHqhgjif4r+8is2sO2+VJhjonPHGS rsdMkpJhD21szkj9KpHBXfsPmLvVeXnbprBJIt7q8H+7ptfiryp+482IkSnhdFYlkvnA JzFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=SbtgFS0miCegQcGLuaz5iU5hSbPDEPNQKgVZ0NNtkAM=; b=KAYg2dN1Z2cdWgwxzMw31X6A5ukyNGz2W3pz1dGhUpsiIQqjrchEC5vsNh6mc1ewyr Zk5Qrps8gHlo0jk4+k1hERzU1q59ycctQ+FuGJk9npiVC9m/NlV441Eup53MtP5tE+u5 qo/rNZ/vMChQ6EB2tpo1PyxnNINPLovx+r5b3IMOyjLKr3izonANB7HU2yJ0UqQX9sgn 5htiqeYomFcVMnHYml2uPnAFQ1dfnXCUY+R+htaQBCPXnI/msB6ohVLow+tuWb3GcG5i qVBmF/UCJ95nTQw8BdR9P/mPqyNpv6NFuIeZporPvD5BGHZ1majKMHFpexBLS+uiUQSB ts3Q== X-Gm-Message-State: AG10YOSBVs831vv2CGlvEuT0IYBoEh46iPF3UPk737daqtTKqwaK4j6CAkOHVLpblAgyWg== X-Received: by 10.129.138.1 with SMTP id a1mr10131789ywg.259.1454294168007; Sun, 31 Jan 2016 18:36:08 -0800 (PST) Received: from mail-yk0-f181.google.com (mail-yk0-f181.google.com. [209.85.160.181]) by smtp.gmail.com with ESMTPSA id c126sm5799531ywa.52.2016.01.31.18.36.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 31 Jan 2016 18:36:07 -0800 (PST) Received: by mail-yk0-f181.google.com with SMTP id z13so32463277ykd.0; Sun, 31 Jan 2016 18:36:06 -0800 (PST) X-Received: by 10.129.106.11 with SMTP id f11mr10096865ywc.168.1454294166590; Sun, 31 Jan 2016 18:36:06 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.79.6 with HTTP; Sun, 31 Jan 2016 18:35:47 -0800 (PST) In-Reply-To: References: <1453862939.42081.25.camel@freebsd.org> <1453867724.42081.28.camel@freebsd.org> <1453903433.42081.30.camel@freebsd.org> <1454192055.32550.8.camel@freebsd.org> From: Jov Date: Mon, 1 Feb 2016 10:35:47 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [Bug 206658] Bus error for pfctl -sa on rpi2 r294499 snap To: Ian Lepore Cc: freebsd-pf@freebsd.org, peter garshtja , freebsd-arm Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2016 02:36:09 -0000 Hi,Ian, r295086 works for me,thanks for your work! Jov blog: http:amutu.com/blog 2016-01-31 9:10 GMT+08:00 Jov : > Nice,will test it. > 2016=E5=B9=B41=E6=9C=8831=E6=97=A5 6:14 AM=EF=BC=8C"Ian Lepore" =E5=86=99=E9=81=93=EF=BC=9A > >> 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=EF=BC=8Cthanks 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=3D0x2065111a, port=3D15268, af=3D= 2 >> > > > > '\002', >> > > > > opts=3D1024) 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 =3D (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=3D185617 >> > > > >> > > > -- 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 >> > " >> > >> >