numam-dpdk/lib/lpm
Vladimir Medvedkin b16ac53657 lpm6: fix buffer overflow
This patch fixes buffer overflow reported by ASAN,
please reference https://bugs.dpdk.org/show_bug.cgi?id=819

The rte_lpm6 keeps routing information for control plane purpose
inside the rte_hash table which uses rte_jhash() as a hash function.
From the rte_jhash() documentation: If input key is not aligned to
four byte boundaries or a multiple of four bytes in length,
the memory region just after may be read (but not used in the
computation).
rte_lpm6 uses 17 bytes keys consisting of IPv6 address (16 bytes) +
depth (1 byte).

This patch increases the size of the depth field up to uint32_t
and sets the alignment to 4 bytes.

Bugzilla ID: 819
Fixes: 86b3b21952 ("lpm6: store rules in hash table")
Cc: stable@dpdk.org

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2021-10-25 19:08:16 +02:00
..
meson.build build/windows: remove separate list of libs 2021-10-22 22:40:59 +02:00
rte_lpm6.c lpm6: fix buffer overflow 2021-10-25 19:08:16 +02:00
rte_lpm6.h
rte_lpm_altivec.h
rte_lpm_neon.h
rte_lpm_sse.h
rte_lpm_sve.h
rte_lpm.c
rte_lpm.h
version.map version: 21.11-rc0 2021-08-17 08:37:52 +02:00