l4p/tcp: fix SIGSEGV when reading IPv6 address 17/22617/1
authorMariusz Drost <mariuszx.drost@intel.com>
Wed, 9 Oct 2019 09:16:20 +0000 (10:16 +0100)
committerMariusz Drost <mariuszx.drost@intel.com>
Wed, 9 Oct 2019 09:32:09 +0000 (10:32 +0100)
commit0e37b2e9d04bbc8e91833e45ce3e4535255a796e
tree965cf35af344129cf46f613335c3784d5a5ca7ad
parente4380f4866091fd92a7a57667dd938a99144f9cd
l4p/tcp: fix SIGSEGV when reading IPv6 address

IPv6 address is obtained through pointer to mbuf (part storing IPv6
addr). Structure which then holds that pointer defines it as a pointer
to _m128i data type. Because of that, when code is optimized,
instruction vmovdqa is used, which requires data to be aligned to
16-bytes. Pointer from mbuf does not have to be aligned in that way,
which may cause SIGSEGV.

Solution is to add attribute packed and aligned(1) to structure holding
IPv6 address. With that, vmovdqu assembly instruction is used, which is
the equivalent of vmovdqa, but for unaligned data.

Signed-off-by: Mariusz Drost <mariuszx.drost@intel.com>
Change-Id: I66e7ce2a317de2cdbc763ec8e31141605b5e5469
lib/libtle_l4p/net_misc.h