Re: [PATCH libnftnl 4/4] src: Use memcpy() to handle potentially unaligned data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 18, 2018 at 11:00 AM Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> wrote:
>
> Hi!
>
> On Wed, Oct 17, 2018 at 12:32:54PM -0700, Matt Turner wrote:
> > Rolf Eike Beer <eike@xxxxxxxxxx> reported that nft-expr_quota-test fails
> > with a SIGBUS on SPARC due to unaligned accesses. This patch resolves
> > that and fixes additional sources of unaligned accesses matching the
> > same pattern. Both nft-expr_quota-test and nft-expr_objref-test
> > generated unaligned accesses on DEC Alpha.
>
> Conversion to use memcpy() is just to stay safe, right? I thought it
> is only 64-bits case that can cause the unaligned access.

Unfortunately not. The case I found in nft-expr_objref-test was a uint32_t :(

But yes, memcpy makes these safe and should be completely inlined
since it's doing small fixed-size copies. `size` tells me that
libnftnl.so.7.3.0 has the same amount of .text on amd64 before and
after this patch.



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux