meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump_4.9.2.bb
Peiran Hong 446bd615fd tcpdump: Fix CVE-2017-16808
Backport selected parts of three upstream commits to fix
CVE-2017-16808 where tcpdump 4.9.2 has a heap-based buffer over-read.

Upstream-Status: Backport
[ several ]

Upstream commits fully backported:
46aead6  [CVE-2017-16808/AoE: Add a missing bounds check]

Upstream commits partially backported:
7068209  [Use nd_ types in 802.x and FDDI headers.]
84ef17a  [Replace ND_TTEST2()/ND_TCHECK2() macros by macros using
pointers (1/n)]

46aead6 fixes the vulnerability and requires two macros defined in
7068209 and 84ef17a, which are committed after the release of 4.9.2.
Only the definition of the macros are taken from the two commits
as they impact a wide range of code and are difficult to integrate.

CVE: CVE-2017-16808

Signed-off-by: Peiran Hong <peiran.hong@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
2019-10-05 09:01:00 -07:00

53 lines
1.5 KiB
BlitzBasic

SUMMARY = "A sophisticated network protocol analyzer"
HOMEPAGE = "http://www.tcpdump.org/"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://LICENSE;md5=1d4b0366557951c84a94fabe3529f867"
SECTION = "net"
DEPENDS = "libpcap"
SRC_URI = " \
http://www.tcpdump.org/release/${BP}.tar.gz \
file://unnecessary-to-check-libpcap.patch \
file://add-ptest.patch \
file://run-ptest \
file://0001-CVE-2017-16808-AoE-Add-a-missing-bounds-check.patch \
"
SRC_URI[md5sum] = "9bbc1ee33dab61302411b02dd0515576"
SRC_URI[sha256sum] = "798b3536a29832ce0cbb07fafb1ce5097c95e308a6f592d14052e1ef1505fe79"
export LIBS=" -lpcap"
inherit autotools-brokensep ptest
CACHED_CONFIGUREVARS = "ac_cv_linux_vers=${ac_cv_linux_vers=2}"
PACKAGECONFIG ??= "openssl"
PACKAGECONFIG[openssl] = "--with-crypto=yes, --without-openssl --without-crypto, openssl"
PACKAGECONFIG[smi] = "--with-smi, --without-smi,libsmi"
PACKAGECONFIG[libcap-ng] = "--with-cap-ng=yes,--with-cap-ng=no,libcap-ng"
EXTRA_AUTORECONF += " -I m4"
do_configure_prepend() {
mkdir -p ${S}/m4
if [ -f aclocal.m4 ]; then
mv aclocal.m4 ${S}/m4
fi
# AC_CHECK_LIB(dlpi.. was looking to host /lib
sed -i 's:-L/lib::g' ./configure.in
}
do_configure_append() {
sed -i 's:-L/usr/lib::' ./Makefile
sed -i 's:-Wl,-rpath,${STAGING_LIBDIR}::' ./Makefile
sed -i 's:-I/usr/include::' ./Makefile
}
do_install_append() {
# tcpdump 4.0.0 installs a copy to /usr/sbin/tcpdump.4.0.0
rm -f ${D}${sbindir}/tcpdump.${PV}
}
do_compile_ptest() {
oe_runmake buildtest-TESTS
}