From 1a4b7ee28bf7413af6513fb45ad0d0736048f866 Mon Sep 17 00:00:00 2001 From: Brad Bishop Date: Sun, 16 Dec 2018 17:11:34 -0800 Subject: reset upstream subtrees to yocto 2.6 Reset the following subtrees on thud HEAD: poky: 87e3a9739d meta-openembedded: 6094ae18c8 meta-security: 31dc4e7532 meta-raspberrypi: a48743dc36 meta-xilinx: c42016e2e6 Also re-apply backports that didn't make it into thud: poky: 17726d0 systemd-systemctl-native: handle Install wildcards meta-openembedded: 4321a5d libtinyxml2: update to 7.0.1 042f0a3 libcereal: Add native and nativesdk classes e23284f libcereal: Allow empty package 030e8d4 rsyslog: curl-less build with fmhttp PACKAGECONFIG 179a1b9 gtest: update to 1.8.1 Squashed OpenBMC subtree compatibility updates: meta-aspeed: Brad Bishop (1): aspeed: add yocto 2.6 compatibility meta-ibm: Brad Bishop (1): ibm: prepare for yocto 2.6 meta-ingrasys: Brad Bishop (1): ingrasys: set layer compatibility to yocto 2.6 meta-openpower: Brad Bishop (1): openpower: set layer compatibility to yocto 2.6 meta-phosphor: Brad Bishop (3): phosphor: set layer compatibility to thud phosphor: libgpg-error: drop patches phosphor: react to fitimage artifact rename Ed Tanous (4): Dropbear: upgrade options for latest upgrade yocto2.6: update openssl options busybox: remove upstream watchdog patch systemd: Rebase CONFIG_CGROUP_BPF patch Change-Id: I7b1fe71cca880d0372a82d94b5fd785323e3a9e7 Signed-off-by: Brad Bishop --- ...1-Catch-std-ifstream-failure-by-reference.patch | 67 ++++++++++++++ .../0001-Fix-string-overflow-in-snprintf.patch | 76 ++++++++++++++++ ...isable-format-overflow-if-supported-by-gc.patch | 34 +++---- ...gure-Pass-linker-specific-options-with-Wl.patch | 10 +-- ..._dump.cc-Use-sys-wait.h-instead-of-wait.h.patch | 12 ++- ...sing-header-limits.h-for-_POSIX_HOST_NAME.patch | 20 ++--- .../0002-Fix-format-truncation-errors.patch | 100 +++++++++++++++++++++ .../0008-check-for-size-before-using-strncpy.patch | 33 +++++++ .../recipes-daemons/opensaf/opensaf_5.18.02.bb | 67 -------------- .../recipes-daemons/opensaf/opensaf_5.18.04.bb | 74 +++++++++++++++ 10 files changed, 386 insertions(+), 107 deletions(-) create mode 100644 meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-Catch-std-ifstream-failure-by-reference.patch create mode 100644 meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-Fix-string-overflow-in-snprintf.patch create mode 100644 meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0002-Fix-format-truncation-errors.patch create mode 100644 meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0008-check-for-size-before-using-strncpy.patch delete mode 100644 meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf_5.18.02.bb create mode 100644 meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf_5.18.04.bb (limited to 'meta-openembedded/meta-networking/recipes-daemons/opensaf') diff --git a/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-Catch-std-ifstream-failure-by-reference.patch b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-Catch-std-ifstream-failure-by-reference.patch new file mode 100644 index 000000000..30fdb8bf1 --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-Catch-std-ifstream-failure-by-reference.patch @@ -0,0 +1,67 @@ +From 38c5343f84799fc5041575f3ec808f7476b6eea3 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 16 Apr 2018 14:33:35 -0700 +Subject: [PATCH] Catch std::ifstream::failure by reference + +Fixes +error: catching polymorphic type 'class std::ios_base::failure' by value +[-Werror=catch-value=] + } catch (std::ofstream::failure) { + ^~~~~~~ + +Signed-off-by: Khem Raj + +--- + src/base/conf.cc | 4 ++-- + src/dtm/dtmnd/dtm_main.cc | 2 +- + src/dtm/dtmnd/multicast.cc | 2 +- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/base/conf.cc b/src/base/conf.cc +index d5755a1..4820357 100644 +--- a/src/base/conf.cc ++++ b/src/base/conf.cc +@@ -189,7 +189,7 @@ std::string Conf::ReadFile(const std::string& path_name, + try { + str.open(path_name); + str >> contents; +- } catch (std::ifstream::failure) { ++ } catch (std::ifstream::failure& e) { + contents.clear(); + } + return (str.fail() || contents.empty()) ? default_contents : contents; +@@ -203,7 +203,7 @@ void Conf::WriteFileAtomically(const std::string& path_name, + try { + str.open(tmp_file, std::ofstream::out | std::ofstream::trunc); + str << contents << std::endl; +- } catch (std::ofstream::failure) { ++ } catch (std::ofstream::failure& e) { + success = false; + } + str.close(); +diff --git a/src/dtm/dtmnd/dtm_main.cc b/src/dtm/dtmnd/dtm_main.cc +index 585e11e..5cf6ad7 100644 +--- a/src/dtm/dtmnd/dtm_main.cc ++++ b/src/dtm/dtmnd/dtm_main.cc +@@ -367,7 +367,7 @@ void UpdateNodeIdFile(DTM_INTERNODE_CB *cb) { + try { + str.open(PKGLOCALSTATEDIR "/node_id", std::ofstream::out); + str << std::hex << node_id << std::endl; +- } catch (std::ofstream::failure) { ++ } catch (std::ofstream::failure& e) { + } + str.close(); + } +diff --git a/src/dtm/dtmnd/multicast.cc b/src/dtm/dtmnd/multicast.cc +index cadc002..7c25fea 100644 +--- a/src/dtm/dtmnd/multicast.cc ++++ b/src/dtm/dtmnd/multicast.cc +@@ -199,7 +199,7 @@ bool Multicast::GetPeersFromFile(const std::string &path_name) { + } + } + } +- } catch (std::ifstream::failure) { ++ } catch (std::ifstream::failure& e) { + LOG_ER("Caught std::ifstream::failure when reading file '%s', peers=%zu", + path_name.c_str(), static_cast(peers_.size())); + peers_.clear(); diff --git a/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-Fix-string-overflow-in-snprintf.patch b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-Fix-string-overflow-in-snprintf.patch new file mode 100644 index 000000000..db6796d05 --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-Fix-string-overflow-in-snprintf.patch @@ -0,0 +1,76 @@ +From ae7178a78aba2e5766b70191617113487fd7ad0b Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 16 Apr 2018 18:29:17 -0700 +Subject: [PATCH] Fix string overflow in snprintf + +Fixes errors like +error: '%s' dir +ective output may be truncated writing up to 255 bytes into a region of size 32 [-Werror=forma +t-truncation=] + snprintf(reinterpret_cast(Healthy.key), sizeof(Healthy.key), "%s", + ^~~~ + hlth_str); + ~~~~~~~~ + +Signed-off-by: Khem Raj + +--- + src/log/logd/lgs_util.cc | 4 ++-- + src/rde/rded/rde_amf.cc | 2 +- + src/smf/smfd/SmfUpgradeCampaign.cc | 4 ++-- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/log/logd/lgs_util.cc b/src/log/logd/lgs_util.cc +index ac93d5a..cce80f3 100644 +--- a/src/log/logd/lgs_util.cc ++++ b/src/log/logd/lgs_util.cc +@@ -200,12 +200,12 @@ char *lgs_get_time(time_t *time_in) { + + stringSize = 5 * sizeof(char); + snprintf(srcString, (size_t)stringSize, "%d", +- (timeStampData->tm_year + START_YEAR)); ++ (timeStampData->tm_year + START_YEAR) & 0x4dU); + + strncpy(timeStampString, srcString, stringSize); + + stringSize = 3 * sizeof(char); +- snprintf(srcString, (size_t)stringSize, "%02d", (timeStampData->tm_mon + 1)); ++ snprintf(srcString, (size_t)stringSize, "%02d", (timeStampData->tm_mon + 1) & 0x2dU); + + strncat(timeStampString, srcString, stringSize); + +diff --git a/src/rde/rded/rde_amf.cc b/src/rde/rded/rde_amf.cc +index 81e521e..d53cc48 100644 +--- a/src/rde/rded/rde_amf.cc ++++ b/src/rde/rded/rde_amf.cc +@@ -102,7 +102,7 @@ static uint32_t rde_amf_healthcheck_start(RDE_AMF_CB *rde_amf_cb) { + SaAmfHealthcheckKeyT Healthy; + SaNameT SaCompName; + char *phlth_ptr; +- char hlth_str[256]; ++ char hlth_str[32]; + + TRACE_ENTER(); + +diff --git a/src/smf/smfd/SmfUpgradeCampaign.cc b/src/smf/smfd/SmfUpgradeCampaign.cc +index 45cdce8..6761bcf 100644 +--- a/src/smf/smfd/SmfUpgradeCampaign.cc ++++ b/src/smf/smfd/SmfUpgradeCampaign.cc +@@ -447,7 +447,7 @@ SaAisErrorT SmfUpgradeCampaign::tooManyRestarts(bool *o_result) { + TRACE_ENTER(); + SaAisErrorT rc = SA_AIS_OK; + SaImmAttrValuesT_2 **attributes; +- int curCnt = 0; ++ short int curCnt = 0; + + /* Read the SmfCampRestartInfo object smfCampRestartCnt attr */ + std::string obj = "smfRestartInfo=info," + +@@ -473,7 +473,7 @@ SaAisErrorT SmfUpgradeCampaign::tooManyRestarts(bool *o_result) { + attrsmfCampRestartCnt.setName("smfCampRestartCnt"); + attrsmfCampRestartCnt.setType("SA_IMM_ATTR_SAUINT32T"); + char buf[5]; +- snprintf(buf, 4, "%d", curCnt); ++ snprintf(buf, 4, "%hd", curCnt); + attrsmfCampRestartCnt.addValue(buf); + imoCampRestartInfo.addValue(attrsmfCampRestartCnt); + diff --git a/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Disable-format-overflow-if-supported-by-gc.patch b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Disable-format-overflow-if-supported-by-gc.patch index effe25c85..be0a58767 100644 --- a/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Disable-format-overflow-if-supported-by-gc.patch +++ b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Disable-format-overflow-if-supported-by-gc.patch @@ -1,20 +1,21 @@ -From ab00d6f5793b2d850f975bcb6d5d0aa6d7a9eaa4 Mon Sep 17 00:00:00 2001 +From c2668f7f2ea82a61115b7cae56ed081b41ff5153 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 22 Apr 2017 12:34:37 -0700 Subject: [PATCH] configure: Disable format-overflow if supported by gcc Signed-off-by: Khem Raj + --- - Makefile.am | 6 ++-- - configure.ac | 2 ++ - m4/ax_check_compile_flag.m4 | 74 +++++++++++++++++++++++++++++++++++++++++++++ + Makefile.am | 6 +-- + configure.ac | 2 + + m4/ax_check_compile_flag.m4 | 74 +++++++++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+), 3 deletions(-) create mode 100644 m4/ax_check_compile_flag.m4 -Index: opensaf-5.18.02/Makefile.am -=================================================================== ---- opensaf-5.18.02.orig/Makefile.am -+++ opensaf-5.18.02/Makefile.am +diff --git a/Makefile.am b/Makefile.am +index b3d6553..5607fc2 100644 +--- a/Makefile.am ++++ b/Makefile.am @@ -52,10 +52,10 @@ AM_CPPFLAGS = \ -pthread \ -D_GNU_SOURCE -DINTERNAL_VERSION_ID='"@INTERNAL_VERSION_ID@"' \ @@ -29,11 +30,11 @@ Index: opensaf-5.18.02/Makefile.am if ENABLE_GCOV AM_CFLAGS += --coverage -Index: opensaf-5.18.02/configure.ac -=================================================================== ---- opensaf-5.18.02.orig/configure.ac -+++ opensaf-5.18.02/configure.ac -@@ -593,6 +593,8 @@ if test -z "$OSAF_HARDEN_FLAGS"; then +diff --git a/configure.ac b/configure.ac +index 5b86730..47d1002 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -600,6 +600,8 @@ if test -z "$OSAF_HARDEN_FLAGS"; then fi AC_SUBST(OSAF_HARDEN_FLAGS) @@ -42,10 +43,11 @@ Index: opensaf-5.18.02/configure.ac ############################################# # List the output Makefiles ############################################# -Index: opensaf-5.18.02/m4/ax_check_compile_flag.m4 -=================================================================== +diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4 +new file mode 100644 +index 0000000..dcabb92 --- /dev/null -+++ opensaf-5.18.02/m4/ax_check_compile_flag.m4 ++++ b/m4/ax_check_compile_flag.m4 @@ -0,0 +1,74 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html diff --git a/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Pass-linker-specific-options-with-Wl.patch b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Pass-linker-specific-options-with-Wl.patch index 5756a027b..e4bbb4c3c 100644 --- a/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Pass-linker-specific-options-with-Wl.patch +++ b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Pass-linker-specific-options-with-Wl.patch @@ -1,4 +1,4 @@ -From 6248b717b4861d16b80235fd8e57d64e4f636428 Mon Sep 17 00:00:00 2001 +From 979b2b6a1aa574a26e8b736049c4207d568f60f3 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 13 Apr 2017 17:39:07 -0700 Subject: [PATCH] configure: Pass linker specific options with -Wl @@ -7,15 +7,16 @@ This helps make it pass the options to linker correctly and we can use non-gcc compilers Signed-off-by: Khem Raj + --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac -index df4fc58..02771c6 100644 +index 12a5d5c..5b86730 100644 --- a/configure.ac +++ b/configure.ac -@@ -553,7 +553,7 @@ if test -z "$OSAF_HARDEN_FLAGS"; then +@@ -596,7 +596,7 @@ if test -z "$OSAF_HARDEN_FLAGS"; then if echo "${CFLAGS} ${CXXFLAGS}" | grep -q -- -O0; then OSAF_HARDEN_FLAGS="" fi @@ -24,6 +25,3 @@ index df4fc58..02771c6 100644 fi AC_SUBST(OSAF_HARDEN_FLAGS) --- -2.12.2 - diff --git a/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-immpbe_dump.cc-Use-sys-wait.h-instead-of-wait.h.patch b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-immpbe_dump.cc-Use-sys-wait.h-instead-of-wait.h.patch index 76c47c658..e40d2b319 100644 --- a/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-immpbe_dump.cc-Use-sys-wait.h-instead-of-wait.h.patch +++ b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-immpbe_dump.cc-Use-sys-wait.h-instead-of-wait.h.patch @@ -1,4 +1,4 @@ -From 508ea7c0d67243feb1684eaa83569cb687561d64 Mon Sep 17 00:00:00 2001 +From c21f77d592415f316138c05f581192a1f061e735 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 15 Sep 2017 10:09:03 -0700 Subject: [PATCH] immpbe_dump.cc: Use sys/wait.h instead of wait.h @@ -7,12 +7,13 @@ Fixes redirecting incorrect #include to Signed-off-by: Khem Raj + --- src/imm/common/immpbe_dump.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/imm/common/immpbe_dump.cc b/src/imm/common/immpbe_dump.cc -index 100222f37..33e47ce3c 100644 +index e6b3cc5..3956028 100644 --- a/src/imm/common/immpbe_dump.cc +++ b/src/imm/common/immpbe_dump.cc @@ -26,12 +26,12 @@ @@ -27,8 +28,5 @@ index 100222f37..33e47ce3c 100644 #include +#include #include - - #include --- -2.14.1 - + #include + #include diff --git a/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-src-Add-missing-header-limits.h-for-_POSIX_HOST_NAME.patch b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-src-Add-missing-header-limits.h-for-_POSIX_HOST_NAME.patch index 4a2a825f9..e4a3975da 100644 --- a/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-src-Add-missing-header-limits.h-for-_POSIX_HOST_NAME.patch +++ b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-src-Add-missing-header-limits.h-for-_POSIX_HOST_NAME.patch @@ -1,4 +1,4 @@ -From 6442b57a855e273aa5a3d93e8596783cea128073 Mon Sep 17 00:00:00 2001 +From 7fb393c66df33110fef0cbabac7d304f12eb82e4 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 15 Sep 2017 09:39:40 -0700 Subject: [PATCH] src: Add missing header limits.h for _POSIX_HOST_NAME_MAX @@ -7,6 +7,7 @@ Use _GNU_SOURCE instead of libc internal __USE_GNU Do not use the deprecated headers under include/sys Signed-off-by: Khem Raj + --- src/base/os_defs.h | 5 +++-- src/mds/mds_dt_tcp.c | 1 - @@ -18,7 +19,7 @@ Signed-off-by: Khem Raj 7 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/base/os_defs.h b/src/base/os_defs.h -index 50a9bf5fc..af6842863 100644 +index a570c43..3559b19 100644 --- a/src/base/os_defs.h +++ b/src/base/os_defs.h @@ -47,17 +47,18 @@ @@ -43,7 +44,7 @@ index 50a9bf5fc..af6842863 100644 #include diff --git a/src/mds/mds_dt_tcp.c b/src/mds/mds_dt_tcp.c -index 1407eb1ab..a87c22faa 100644 +index 1407eb1..a87c22f 100644 --- a/src/mds/mds_dt_tcp.c +++ b/src/mds/mds_dt_tcp.c @@ -27,7 +27,6 @@ @@ -55,7 +56,7 @@ index 1407eb1ab..a87c22faa 100644 #include #include diff --git a/src/mds/mds_dt_tcp_disc.h b/src/mds/mds_dt_tcp_disc.h -index a6249d73e..574f52681 100644 +index a6249d7..574f526 100644 --- a/src/mds/mds_dt_tcp_disc.h +++ b/src/mds/mds_dt_tcp_disc.h @@ -24,7 +24,7 @@ @@ -68,7 +69,7 @@ index a6249d73e..574f52681 100644 /* mds_indentifire + mds_version + msg_type + scope_type + server_type + server_instance_lower + server_instance_upper + sub_ref_val + sub_ref_val + diff --git a/src/mds/mds_dt_tipc.c b/src/mds/mds_dt_tipc.c -index 37745e7f0..9b3255567 100644 +index 7714175..a0ed3b6 100644 --- a/src/mds/mds_dt_tipc.c +++ b/src/mds/mds_dt_tipc.c @@ -35,7 +35,6 @@ @@ -80,7 +81,7 @@ index 37745e7f0..9b3255567 100644 #include #include diff --git a/src/mds/mds_dt_tipc.h b/src/mds/mds_dt_tipc.h -index e73a11b09..401d208c2 100644 +index e73a11b..401d208 100644 --- a/src/mds/mds_dt_tipc.h +++ b/src/mds/mds_dt_tipc.h @@ -32,7 +32,7 @@ @@ -93,7 +94,7 @@ index e73a11b09..401d208c2 100644 #include #include diff --git a/src/mds/mds_dt_trans.c b/src/mds/mds_dt_trans.c -index 6f621e04e..5aacbd33e 100644 +index 6f621e0..5aacbd3 100644 --- a/src/mds/mds_dt_trans.c +++ b/src/mds/mds_dt_trans.c @@ -26,7 +26,6 @@ @@ -105,7 +106,7 @@ index 6f621e04e..5aacbd33e 100644 #define MDS_PROT_TCP 0xA0 diff --git a/src/ntf/ntfd/NtfLogger.cc b/src/ntf/ntfd/NtfLogger.cc -index 84014b578..31b1ccc6c 100644 +index fd17c58..1120008 100644 --- a/src/ntf/ntfd/NtfLogger.cc +++ b/src/ntf/ntfd/NtfLogger.cc @@ -20,7 +20,7 @@ @@ -117,6 +118,3 @@ index 84014b578..31b1ccc6c 100644 #include "base/osaf_utility.h" #include --- -2.14.1 - diff --git a/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0002-Fix-format-truncation-errors.patch b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0002-Fix-format-truncation-errors.patch new file mode 100644 index 000000000..f98e28da9 --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0002-Fix-format-truncation-errors.patch @@ -0,0 +1,100 @@ +From c5034fe42df8923bcefc10e163151997d70b6241 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 16 Apr 2018 14:56:47 -0700 +Subject: [PATCH] Fix format-truncation errors + +Fixes errors with gcc8 eg. +error: '%u' directive output may be truncated writing between 1 and 10 bytes into a region of size between 0 and 254 [-Werror=format-truncation=] + +Signed-off-by: Khem Raj + +--- + src/base/daemon.c | 4 ++-- + src/mds/mds_c_db.c | 8 ++++---- + src/mds/mds_core.h | 4 ++-- + src/mds/mds_dt2c.h | 2 +- + 4 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/src/base/daemon.c b/src/base/daemon.c +index 361dd8d..4001b73 100644 +--- a/src/base/daemon.c ++++ b/src/base/daemon.c +@@ -95,11 +95,11 @@ static int __create_pidfile(const char *pidfile) + { + FILE *file = NULL; + int fd, rc = 0; +- char pidfiletmp[NAME_MAX] = {0}; ++ char pidfiletmp[NAME_MAX+12] = {0}; + pid_t pid; + + pid = getpid(); +- snprintf(pidfiletmp, NAME_MAX, "%s.%u.tmp", pidfile, pid); ++ snprintf(pidfiletmp, NAME_MAX+12, "%s.%u.tmp", pidfile, pid); + + /* open the file and associate a stream with it */ + if (((fd = open(pidfiletmp, O_RDWR | O_CREAT, 0644)) == -1) || +diff --git a/src/mds/mds_c_db.c b/src/mds/mds_c_db.c +index e6b95cd..3d4a222 100644 +--- a/src/mds/mds_c_db.c ++++ b/src/mds/mds_c_db.c +@@ -124,10 +124,10 @@ void get_adest_details(MDS_DEST adest, char *adest_details) + } + + if (remote == true) +- snprintf(adest_details, MDS_MAX_PROCESS_NAME_LEN, ++ snprintf(adest_details, MDS_MAX_PROCESS_NAME_LEN+24, + "", ncs_node_id, process_name); + else +- snprintf(adest_details, MDS_MAX_PROCESS_NAME_LEN, ++ snprintf(adest_details, MDS_MAX_PROCESS_NAME_LEN+24, + "", ncs_node_id, process_name); + + m_MDS_LOG_DBG("MDS:DB: adest_details: %s ", adest_details); +@@ -207,10 +207,10 @@ void get_subtn_adest_details(MDS_PWE_HDL pwe_hdl, MDS_SVC_ID svc_id, + } + + if (remote == true) +- snprintf(adest_details, MDS_MAX_PROCESS_NAME_LEN, ++ snprintf(adest_details, MDS_MAX_PROCESS_NAME_LEN+24, + "", ncs_node_id, process_name); + else +- snprintf(adest_details, MDS_MAX_PROCESS_NAME_LEN, ++ snprintf(adest_details, MDS_MAX_PROCESS_NAME_LEN+24, + "", ncs_node_id, process_name); + done: + m_MDS_LOG_DBG("MDS:DB: adest_details: %s ", adest_details); +diff --git a/src/mds/mds_core.h b/src/mds/mds_core.h +index 37696d4..7f5225d 100644 +--- a/src/mds/mds_core.h ++++ b/src/mds/mds_core.h +@@ -163,7 +163,7 @@ typedef struct mds_subscription_results_info { + uint32_t msg_snd_cnt; /* Message send count to this destination */ + uint32_t msg_rcv_cnt; /* Message rcv count from this destination */ + char sub_adest_details +- [MDS_MAX_PROCESS_NAME_LEN]; /* */ ++ [MDS_MAX_PROCESS_NAME_LEN+24]; /* */ + + } MDS_SUBSCRIPTION_RESULTS_INFO; + +@@ -194,7 +194,7 @@ typedef struct mds_subscription_info { + count is grater than ZERO bcast (multi-unicast) */ + uint32_t prev_ver_sub_count; + char sub_adest_details +- [MDS_MAX_PROCESS_NAME_LEN]; /* */ ++ [MDS_MAX_PROCESS_NAME_LEN+24]; /* */ + + } MDS_SUBSCRIPTION_INFO; + +diff --git a/src/mds/mds_dt2c.h b/src/mds/mds_dt2c.h +index 012999c..006b722 100644 +--- a/src/mds/mds_dt2c.h ++++ b/src/mds/mds_dt2c.h +@@ -143,7 +143,7 @@ typedef struct mdtm_send_req { + */ + MDS_DEST adest; /* MDTM to do local/remote routing, destination adest */ + char sub_adest_details +- [MDS_MAX_PROCESS_NAME_LEN]; /* */ ++ [MDS_MAX_PROCESS_NAME_LEN+24]; /* */ + MDS_SEND_PRIORITY_TYPE pri; + MDS_CLIENT_MSG_FORMAT_VER + msg_fmt_ver; /* message format version specification */ diff --git a/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0008-check-for-size-before-using-strncpy.patch b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0008-check-for-size-before-using-strncpy.patch new file mode 100644 index 000000000..497bb07d8 --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0008-check-for-size-before-using-strncpy.patch @@ -0,0 +1,33 @@ +From 29510dd81e3a5e96151afdb0702863cbfd640766 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 22 Jun 2018 18:58:59 -0700 +Subject: [PATCH] check for size before using strncpy + +ensures that size is never execeding the string length +that execPath can hold + +Fixes +error: '__builtin___strncpy_chk' specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=] + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + src/imm/immnd/immnd_proc.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/imm/immnd/immnd_proc.c b/src/imm/immnd/immnd_proc.c +index 015932a..c8f115e 100644 +--- a/src/imm/immnd/immnd_proc.c ++++ b/src/imm/immnd/immnd_proc.c +@@ -1902,6 +1902,10 @@ static int immnd_forkPbe(IMMND_CB *cb) + LOG_ER("Pathname too long: %u max is 1023", newLen); + return -1; + } ++ if (execDirLen > 1023 || execDirLen < 0) { ++ LOG_ER("Execdir name too long: %u max is 1023", execDirLen); ++ return -1; ++ } + + strncpy(execPath, cb->mProgName, execDirLen); + execPath[execDirLen] = 0; diff --git a/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf_5.18.02.bb b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf_5.18.02.bb deleted file mode 100644 index 4b556ce8c..000000000 --- a/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf_5.18.02.bb +++ /dev/null @@ -1,67 +0,0 @@ -SUMMARY = "OpenSAF is an open source implementation of the SAF AIS specification" -DESCRIPTION = "OpenSAF is an open source project established to develop a base platform \ -middleware consistent with Service Availability Forum (SA Forum) \ -specifications, under the LGPLv2.1 license. The OpenSAF Foundation was \ -established by leading Communications and Enterprise Computing Companies to \ -facilitate the OpenSAF Project and to accelerate the adoption of the OpenSAF \ -code base in commercial products. \ -The OpenSAF project was launched in mid 2007 and has been under development by \ -an informal group of supporters of the OpenSAF initiative. The OpenSAF \ -Foundation was founded on January 22nd 2008 with Emerson Network Power, \ -Ericsson, Nokia Siemens Networks, HP and Sun Microsystems as founding members." -HOMEPAGE = "http://www.opensaf.org" -SECTION = "admin" -LICENSE = "LGPLv2.1" -LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=a916467b91076e631dd8edb7424769c7" - -DEPENDS = "libxml2 python" -TOOLCHAIN = "gcc" - -SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}" - -SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/releases/${BPN}-${PV}.tar.gz \ - file://0001-configure-Pass-linker-specific-options-with-Wl.patch \ - file://0001-configure-Disable-format-overflow-if-supported-by-gc.patch \ - file://0001-src-Add-missing-header-limits.h-for-_POSIX_HOST_NAME.patch \ - file://0001-immpbe_dump.cc-Use-sys-wait.h-instead-of-wait.h.patch \ -" -SRC_URI[md5sum] = "42064f5ddbc7f560bfc5ff93ea9eecc7" -SRC_URI[sha256sum] = "f9e24897f9cfd63bb3115f6275c706de1702d3d9bae2fc423227db72b23c37f0" - -inherit autotools useradd systemd pkgconfig - -USERADD_PACKAGES = "${PN}" -GROUPADD_PARAM_${PN} = "-f -r opensaf" -USERADD_PARAM_${PN} = "-r -g opensaf -d ${datadir}/opensaf/ -s ${sbindir}/nologin -c \"OpenSAF\" opensaf" - -SYSTEMD_SERVICE_${PN} += "opensafd.service" -SYSTEMD_AUTO_ENABLE = "disable" - -PACKAGECONFIG[systemd] = ",,systemd" -PACKAGECONFIG[openhpi] = "--with-hpi-interface=B03 --enable-ais-plm,,openhpi" - -PACKAGECONFIG_append = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd', '', d)}" - -PKGLIBDIR="${libdir}" - -LDFLAGS += "-Wl,--as-needed -latomic -Wl,--no-as-needed" - -do_install_append() { - cp -av --no-preserve=ownership ${B}/lib/.libs/*.so* ${D}${libdir} - rm -fr "${D}${localstatedir}/lock" - rm -fr "${D}${localstatedir}/run" - rmdir --ignore-fail-on-non-empty "${D}${localstatedir}" - rmdir --ignore-fail-on-non-empty "${D}${datadir}/java" - if [ ! -d "${D}${sysconfdir}/init.d" ]; then - install -d ${D}${sysconfdir}/init.d - install -m 0755 ${B}/osaf/services/infrastructure/nid/scripts/opensafd ${D}${sysconfdir}/init.d/ - fi -} - -FILES_${PN} += "${systemd_unitdir}/system/*.service" -FILES_${PN}-staticdev += "${PKGLIBDIR}/*.a" - -INSANE_SKIP_${PN} = "dev-so" - -RDEPENDS_${PN} += "bash python" - diff --git a/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf_5.18.04.bb b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf_5.18.04.bb new file mode 100644 index 000000000..c534c6206 --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf_5.18.04.bb @@ -0,0 +1,74 @@ +SUMMARY = "OpenSAF is an open source implementation of the SAF AIS specification" +DESCRIPTION = "OpenSAF is an open source project established to develop a base platform \ +middleware consistent with Service Availability Forum (SA Forum) \ +specifications, under the LGPLv2.1 license. The OpenSAF Foundation was \ +established by leading Communications and Enterprise Computing Companies to \ +facilitate the OpenSAF Project and to accelerate the adoption of the OpenSAF \ +code base in commercial products. \ +The OpenSAF project was launched in mid 2007 and has been under development by \ +an informal group of supporters of the OpenSAF initiative. The OpenSAF \ +Foundation was founded on January 22nd 2008 with Emerson Network Power, \ +Ericsson, Nokia Siemens Networks, HP and Sun Microsystems as founding members." +HOMEPAGE = "http://www.opensaf.org" +SECTION = "admin" +LICENSE = "LGPLv2.1" +LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=a916467b91076e631dd8edb7424769c7" + +DEPENDS = "libxml2 python" +TOOLCHAIN = "gcc" + +SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}" + +SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/releases/${BPN}-${PV}.tar.gz \ + file://0001-configure-Pass-linker-specific-options-with-Wl.patch \ + file://0001-configure-Disable-format-overflow-if-supported-by-gc.patch \ + file://0001-src-Add-missing-header-limits.h-for-_POSIX_HOST_NAME.patch \ + file://0001-immpbe_dump.cc-Use-sys-wait.h-instead-of-wait.h.patch \ + file://0001-Catch-std-ifstream-failure-by-reference.patch \ + file://0002-Fix-format-truncation-errors.patch \ + file://0001-Fix-string-overflow-in-snprintf.patch \ + file://0008-check-for-size-before-using-strncpy.patch \ + " +SRC_URI[md5sum] = "21836e43b13ad33bed9bd0ed391e5a6e" +SRC_URI[sha256sum] = "e55dc2645487fb22938e8386b99eef6eb7aff43a246ce3e92488daf6ee46247a" + +inherit autotools useradd systemd pkgconfig + +USERADD_PACKAGES = "${PN}" +GROUPADD_PARAM_${PN} = "-f -r opensaf" +USERADD_PARAM_${PN} = "-r -g opensaf -d ${datadir}/opensaf/ -s ${sbindir}/nologin -c \"OpenSAF\" opensaf" + +SYSTEMD_SERVICE_${PN} += "opensafd.service" +SYSTEMD_AUTO_ENABLE = "disable" + +PACKAGECONFIG[systemd] = ",,systemd" +PACKAGECONFIG[openhpi] = "--with-hpi-interface=B03,,openhpi" +PACKAGECONFIG[plm] = "--enable-ais-plm,--disable-ais-plm,libvirt openhpi" + +PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd', '', d)}" + +PKGLIBDIR="${libdir}" + +LDFLAGS += "-Wl,--as-needed -latomic -Wl,--no-as-needed" + +do_install_append() { + cp -av --no-preserve=ownership ${B}/lib/.libs/*.so* ${D}${libdir} + rm -fr "${D}${localstatedir}/lock" + rm -fr "${D}${localstatedir}/run" + rmdir --ignore-fail-on-non-empty "${D}${localstatedir}" + rmdir --ignore-fail-on-non-empty "${D}${datadir}/java" + if [ ! -d "${D}${sysconfdir}/init.d" ]; then + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${B}/osaf/services/infrastructure/nid/scripts/opensafd ${D}${sysconfdir}/init.d/ + fi +} + +FILES_${PN} += "${systemd_unitdir}/system/*.service" +FILES_${PN}-staticdev += "${PKGLIBDIR}/*.a" + +INSANE_SKIP_${PN} = "dev-so" + +RDEPENDS_${PN} += "bash python" + +# http://errors.yoctoproject.org/Errors/Details/186970/ +EXCLUDE_FROM_WORLD_libc-musl = "1" -- cgit v1.2.3