Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Feb 2016 10:35:47 +0800
From:      Jov <amutu@amutu.com>
To:        Ian Lepore <ian@freebsd.org>
Cc:        freebsd-pf@freebsd.org, peter garshtja <peter.garshtja@ambient-md.com>,  freebsd-arm <freebsd-arm@freebsd.org>
Subject:   Re: [Bug 206658] Bus error for pfctl -sa on rpi2 r294499 snap
Message-ID:  <CADyrUxN5RSS2PBsUuLvx4q4EiEmaAPkkuegB3ELRBNFmZW=FEg@mail.gmail.com>
In-Reply-To: <CADyrUxMV81t43vYkgwb880FwYF3D6_2e9dWJL4pqNJh1JY2sQA@mail.gmail.com>
References:  <bug-206658-7@https.bugs.freebsd.org/bugzilla/> <1453862939.42081.25.camel@freebsd.org> <CADyrUxPcndOaeUn_UcDN4F=N5XHsby-wQmLvRfUcYNTjNJPUiQ@mail.gmail.com> <1453867724.42081.28.camel@freebsd.org> <CADyrUxO-X3f6gXDHSKZ1Xy5PFxtZrsM0kiJrnN5MPhaAC5MZkA@mail.gmail.com> <1453903433.42081.30.camel@freebsd.org> <CADyrUxPhubhCi6MPBO4eX4WEXCxbMvcz9ZJEzt36azw6dcH8eA@mail.gmail.com> <CAC67Hz8Oxzi_NqKP2ORx2u9GxgXio8ckbrmqh82DCDR38AQ_fw@mail.gmail.com> <CADyrUxN02=%2BPoV81jyEa-hGR_szS6t==c=XKOhn9pdu-OnSGFA@mail.gmail.com> <CALFUBVH9Sjt2-pB%2BfRw4naEF88JGx_uB1N%2BvUjQMCMQNSE_o5w@mail.gmail.com> <1454192055.32550.8.camel@freebsd.org> <CADyrUxMV81t43vYkgwb880FwYF3D6_2e9dWJL4pqNJh1JY2sQA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,Ian,
 r295086 works for me,thanks for your work!

Jov
blog: http:amutu.com/blog <http://amutu.com/blog>;

2016-01-31 9:10 GMT+08:00 Jov <amutu@amutu.com>:

> Nice,will test it.
> 2016=E5=B9=B41=E6=9C=8831=E6=97=A5 6:14 AM=EF=BC=8C"Ian Lepore" <ian@free=
bsd.org>=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 <amutu@amutu.com> 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 <http://amutu.com/blog>;
>> > >
>> > > 2016-01-29 5:26 GMT+08:00 Guy Yur <guyyur@gmail.com <javascript:;>>
>> > > :
>> > >
>> > > > Hi,
>> > > >
>> > > > On Thu, Jan 28, 2016 at 2:06 PM, Jov <amutu@amutu.com <javascript
>> > > > :;>>
>> > > 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 <javascript:;> mailing list
>> > > https://lists.freebsd.org/mailman/listinfo/freebsd-arm
>> > > To unsubscribe, send any mail to "
>> > > freebsd-arm-unsubscribe@freebsd.org
>> > > <javascript:;>"
>> > _______________________________________________
>> > 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
>> > "
>> >
>>
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADyrUxN5RSS2PBsUuLvx4q4EiEmaAPkkuegB3ELRBNFmZW=FEg>