From a0c85c52bf5f0fd7d4e0f8c09a2ad5f01a955400 Mon Sep 17 00:00:00 2001 From: zengweifeng Date: Tue, 26 Jan 2021 19:23:02 +0800 Subject: [PATCH] check the return value of ecp_create --- lldpad.spec | 9 +++++- ...lldp-ecp-allow-for-failure-to-create.patch | 29 +++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 open-lldp-ecp-allow-for-failure-to-create.patch diff --git a/lldpad.spec b/lldpad.spec index d467582..6fcaa8e 100644 --- a/lldpad.spec +++ b/lldpad.spec @@ -4,7 +4,7 @@ Name: lldpad Version: 1.0.1 -Release: 15 +Release: 16 Summary: Intel LLDP Agent License: GPLv2 URL: https://www.open-lldp.org @@ -37,6 +37,7 @@ Patch25: open-lldp-v1.0.1-25-l2_linux_packet-correctly-process-return-value- Patch26: open-lldp-v1.0.1-26-lldpad-system-capability-incorrect-advertised-as-sta.patch Patch27: open-lldp-v1.0.1-27-fix-build-warnings.patch Patch28: CVE-2018-10932.patch +Patch29: open-lldp-ecp-allow-for-failure-to-create.patch BuildRequires: automake autoconf libtool flex kernel-headers libconfig-devel BuildRequires: libnl3-devel readline-devel systemd git @@ -111,6 +112,12 @@ make check %{_mandir}/man*/* %changelog +* Tue Jan 26 2021 zengwefeng - 1.0.1-16 +- Type:bugfix +- Id:NA +- SUG:NA +- DESC:check the return value of ecp_create + * Wed Sep 30 2020 wangxiaopeng - 1.0.1-15 - Type:CVE - Id:CVE-2018-10932 diff --git a/open-lldp-ecp-allow-for-failure-to-create.patch b/open-lldp-ecp-allow-for-failure-to-create.patch new file mode 100644 index 0000000..b2c88ac --- /dev/null +++ b/open-lldp-ecp-allow-for-failure-to-create.patch @@ -0,0 +1,29 @@ +From 488051ae0b88b8b77081fadff8154dbd4ddfd54c Mon Sep 17 00:00:00 2001 +From: rpm-build +Date: Tue, 26 Jan 2021 16:16:17 +0800 +Subject: [PATCH] ecp-allow-for-failure-to-create.patch + +--- + qbg/ecp22.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/qbg/ecp22.c b/qbg/ecp22.c +index 4640701..ba8f891 100644 +--- a/qbg/ecp22.c ++++ b/qbg/ecp22.c +@@ -782,7 +782,11 @@ void ecp22_start(char *ifname) + ecp = find_ecpdata(ifname, eud); + if (!ecp) + ecp = ecp22_create(ifname, eud); +- ecp->max_retries = ECP22_MAX_RETRIES_DEFAULT; ++ if (!ecp) { ++ LLDPAD_DBG("%s:%s failed creating ECP22 instance\n", __func__, ifname); ++ return; ++ } ++ ecp->max_retries = ECP22_MAX_RETRIES_DEFAULT; + ecp->max_rte = ECP22_ACK_TIMER_DEFAULT; + LIST_INIT(&ecp->inuse.head); + ecp->inuse.last = 0; +-- +2.23.0 + -- Gitee