diff options
author | takeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp> | 2020-11-02 11:07:33 +0900 |
---|---|---|
committer | takeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp> | 2020-11-02 11:07:33 +0900 |
commit | 1c7d6584a7811b7785ae5c1e378f14b5ba0971cf (patch) | |
tree | cd70a267a5ef105ba32f200aa088e281fbd85747 /external/meta-openembedded/meta-networking/recipes-support/tcpdump | |
parent | 4204309872da5cb401cbb2729d9e2d4869a87f42 (diff) |
basesystem-jjsandbox/ToshikazuOhiwa/master-jj
recipes
Diffstat (limited to 'external/meta-openembedded/meta-networking/recipes-support/tcpdump')
7 files changed, 107 insertions, 131 deletions
diff --git a/external/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/0001-CVE-2017-16808-AoE-Add-a-missing-bounds-check.patch b/external/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/0001-CVE-2017-16808-AoE-Add-a-missing-bounds-check.patch deleted file mode 100644 index 919f2b00..00000000 --- a/external/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/0001-CVE-2017-16808-AoE-Add-a-missing-bounds-check.patch +++ /dev/null @@ -1,61 +0,0 @@ -From c45443a0d3e16b92622bea6b589e5930e8f0d815 Mon Sep 17 00:00:00 2001 -From: Peiran Hong <peiran.hong@windriver.com> -Date: Fri, 13 Sep 2019 17:02:57 -0400 -Subject: [PATCH] CVE-2017-16808/AoE: Add a missing bounds check. - ---- - netdissect.h | 12 ++++++++++++ - print-aoe.c | 1 + - 2 files changed, 13 insertions(+) - -diff --git a/netdissect.h b/netdissect.h -index 089b0406..cd05fdb9 100644 ---- a/netdissect.h -+++ b/netdissect.h -@@ -69,6 +69,11 @@ typedef struct { - typedef unsigned char nd_uint8_t; - typedef signed char nd_int8_t; - -+/* -+ * Use this for MAC addresses. -+ */ -+#define MAC_ADDR_LEN 6 /* length of MAC addresses */ -+ - /* snprintf et al */ - - #include <stdarg.h> -@@ -309,12 +314,19 @@ struct netdissect_options { - ((uintptr_t)ndo->ndo_snapend - (l) <= (uintptr_t)ndo->ndo_snapend && \ - (uintptr_t)&(var) <= (uintptr_t)ndo->ndo_snapend - (l))) - -+#define ND_TTEST_LEN(p, l) \ -+ (IS_NOT_NEGATIVE(l) && \ -+ ((uintptr_t)ndo->ndo_snapend - (l) <= (uintptr_t)ndo->ndo_snapend && \ -+ (uintptr_t)(p) <= (uintptr_t)ndo->ndo_snapend - (l))) -+ - /* True if "var" was captured */ - #define ND_TTEST(var) ND_TTEST2(var, sizeof(var)) - - /* Bail if "l" bytes of "var" were not captured */ - #define ND_TCHECK2(var, l) if (!ND_TTEST2(var, l)) goto trunc - -+#define ND_TCHECK_LEN(p, l) if (!ND_TTEST_LEN(p, l)) goto trunc -+ - /* Bail if "var" was not captured */ - #define ND_TCHECK(var) ND_TCHECK2(var, sizeof(var)) - -diff --git a/print-aoe.c b/print-aoe.c -index 97e93df2..ac097a04 100644 ---- a/print-aoe.c -+++ b/print-aoe.c -@@ -325,6 +325,7 @@ aoev1_reserve_print(netdissect_options *ndo, - goto invalid; - /* addresses */ - for (i = 0; i < nmacs; i++) { -+ ND_TCHECK_LEN(cp, MAC_ADDR_LEN); - ND_PRINT((ndo, "\n\tEthernet Address %u: %s", i, etheraddr_string(ndo, cp))); - cp += ETHER_ADDR_LEN; - } --- -2.21.0 - diff --git a/external/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/add-ptest.patch b/external/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/add-ptest.patch index b71435a0..f8ff354f 100644 --- a/external/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/add-ptest.patch +++ b/external/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/add-ptest.patch @@ -1,18 +1,19 @@ -From 8ee1ab1ac89557d48ac1ab7ddcc3c51be9b734ad Mon Sep 17 00:00:00 2001 +From 8c9c728757f89ebe6c4019114b83a63c63596f69 Mon Sep 17 00:00:00 2001 From: "Hongjun.Yang" <hongjun.yang@windriver.com> -Date: Wed, 22 Oct 2014 10:02:48 +0800 +Date: Wed, 2 Oct 2019 16:57:06 -0400 Subject: [PATCH] Add ptest for tcpdump Upstream-Status: Pending Signed-off-by: Hongjun.Yang <hongjun.yang@windriver.com> +Signed-off-by: Peiran Hong <peiran.hong@windriver.com> --- Makefile.in | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in -index 0941f0e..3ce40c6 100644 +index 3b589184..7b10e38c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -437,9 +437,17 @@ distclean: @@ -23,7 +24,7 @@ index 0941f0e..3ce40c6 100644 +buildtest-TESTS: tcpdump + +runtest-PTEST: - (cd tests && ./TESTrun.sh) + (mkdir -p tests && SRCDIR=`cd ${srcdir}; pwd` && export SRCDIR && $$SRCDIR/tests/TESTrun.sh ) +install-ptest: + cp -r tests $(DESTDIR) diff --git a/external/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/avoid-absolute-path-when-searching-for-libdlpi.patch b/external/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/avoid-absolute-path-when-searching-for-libdlpi.patch new file mode 100644 index 00000000..977ab95b --- /dev/null +++ b/external/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/avoid-absolute-path-when-searching-for-libdlpi.patch @@ -0,0 +1,31 @@ +From 02085028cdaf075943c27ebc02bb6de0289ec1d3 Mon Sep 17 00:00:00 2001 +From: Andre McCurdy <armccurdy@gmail.com> +Date: Wed, 2 Oct 2019 16:43:48 -0400 +Subject: [PATCH] avoid absolute path when searching for libdlpi + +Let the build environment control library search paths. + +Upstream-Status: Inappropriate [OE specific] + +Signed-off-by: Andre McCurdy <armccurdy@gmail.com> +Signed-off-by: Peiran Hong <peiran.hong@windriver.com> +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 3401a7a3..6a52485a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -528,7 +528,7 @@ don't.]) + fi + + # libdlpi is needed for Solaris 11 and later. +-AC_CHECK_LIB(dlpi, dlpi_walk, LIBS="$LIBS -ldlpi" LDFLAGS="-L/lib $LDFLAGS", ,-L/lib) ++AC_CHECK_LIB(dlpi, dlpi_walk, LIBS="$LIBS -ldlpi") + + dnl + dnl Check for "pcap_list_datalinks()", "pcap_set_datalink()", +-- +2.17.1 + diff --git a/external/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/run-ptest b/external/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/run-ptest index c03a8b8e..2bfb2267 100755 --- a/external/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/run-ptest +++ b/external/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/run-ptest @@ -1,5 +1,5 @@ #!/bin/sh make -k runtest-PTEST | sed -e '/: passed/ s/^/PASS: /g' \ - -e '/: failed/ s/^/FAIL: /g' \ + -e '/: TEST FAILED.*/ s/^/FAIL: /g' \ -e 's/: passed//g' \ - -e 's/: failed//g' + -e 's/: TEST FAILED.*//g' diff --git a/external/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/unnecessary-to-check-libpcap.patch b/external/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/unnecessary-to-check-libpcap.patch index 8cefadf2..8793bf7a 100644 --- a/external/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/unnecessary-to-check-libpcap.patch +++ b/external/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/unnecessary-to-check-libpcap.patch @@ -1,10 +1,8 @@ -From 741d77e42fc4af49804f7ee43b7237e01633cbcd Mon Sep 17 00:00:00 2001 +From dd023c133980fcc0cff5896e85377675e0571894 Mon Sep 17 00:00:00 2001 From: Roy Li <rongqing.li@windriver.com> Date: Tue, 8 Jul 2014 13:20:47 +0800 Subject: [PATCH] unnecessary to check libpcap -Upstream-Status: Pending - since the check of libpcap did not consider the cross-compile, lead to the below error: This autoconf log indicates errors, it looked at host include and/or @@ -13,22 +11,30 @@ below error: In fact, the libpcap has been added into the tcpdump's DEPENDS, not need to check if libpcap existed. -Signed-off-by: Roy Li <rongqing.li@windriver.com> +Upstream-Status: Inappropriate [OE specific] +Signed-off-by: Roy Li <rongqing.li@windriver.com> +Signed-off-by: Andre McCurdy <armccurdy@gmail.com> +Signed-off-by: Peiran Hong <peiran.hong@windriver.com> --- - configure.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + configure.ac | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) -diff --git a/configure.in b/configure.in -index b2305a5..b3b5dbf 100644 ---- a/configure.in -+++ b/configure.in -@@ -418,7 +418,7 @@ dnl Some platforms may need -lnsl for getrpcbynumber. +diff --git a/configure.ac b/configure.ac +index 56e2a624..3401a7a3 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -404,7 +404,9 @@ dnl Some platforms may need -lnsl for getrpcbynumber. AC_SEARCH_LIBS(getrpcbynumber, nsl, AC_DEFINE(HAVE_GETRPCBYNUMBER, 1, [define if you have getrpcbynumber()])) -AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS) -+#AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS) ++# Simplified (more cross compile friendly) check for libpcap. All we really ++# need is to sanity check that libpcap is available and add -lpcap to LIBS. ++AC_CHECK_LIB(pcap, pcap_compile, LIBS="$LIBS -lpcap") # # Check for these after AC_LBL_LIBPCAP, so we link with the appropriate +-- +2.17.1 + diff --git a/external/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump_4.9.2.bb b/external/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump_4.9.2.bb deleted file mode 100644 index 14e90b09..00000000 --- a/external/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump_4.9.2.bb +++ /dev/null @@ -1,52 +0,0 @@ -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 -} diff --git a/external/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump_4.9.3.bb b/external/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump_4.9.3.bb new file mode 100644 index 00000000..94543dd1 --- /dev/null +++ b/external/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump_4.9.3.bb @@ -0,0 +1,51 @@ +SUMMARY = "A sophisticated network protocol analyzer" +HOMEPAGE = "http://www.tcpdump.org/" +SECTION = "net" +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=1d4b0366557951c84a94fabe3529f867" + +DEPENDS = "libpcap" + +RDEPENDS_${PN}-ptest += " make perl \ + perl-module-file-basename \ + perl-module-posix \ + perl-module-carp" + +SRC_URI = " \ + http://www.tcpdump.org/release/${BP}.tar.gz \ + file://unnecessary-to-check-libpcap.patch \ + file://avoid-absolute-path-when-searching-for-libdlpi.patch \ + file://add-ptest.patch \ + file://run-ptest \ +" + +SRC_URI[md5sum] = "a4ead41d371f91aa0a2287f589958bae" +SRC_URI[sha256sum] = "2cd47cb3d460b6ff75f4a9940f594317ad456cfbf2bd2c8e5151e16559db6410" + +inherit autotools-brokensep ptest + +PACKAGECONFIG ?= "openssl" + +PACKAGECONFIG[libcap-ng] = "--with-cap-ng,--without-cap-ng,libcap-ng" +PACKAGECONFIG[openssl] = "--with-crypto,--without-crypto,openssl" +PACKAGECONFIG[smi] = "--with-smi,--without-smi,libsmi" +# Note: CVE-2018-10103 (SMB - partially fixed, but SMB printing disabled) +PACKAGECONFIG[smb] = "--enable-smb,--disable-smb" + +EXTRA_AUTORECONF += "-I m4" + +do_configure_prepend() { + mkdir -p ${S}/m4 + if [ -f aclocal.m4 ]; then + mv aclocal.m4 ${S}/m4 + fi +} + +do_install_append() { + # make install installs an unneeded extra copy of the tcpdump binary + rm -f ${D}${sbindir}/tcpdump.${PV} +} + +do_compile_ptest() { + oe_runmake buildtest-TESTS +} |