check the return value of ecp_create

This commit is contained in:
zengweifeng 2021-01-26 19:08:36 +08:00
parent 9acd6243b5
commit 29e49f5796
2 changed files with 37 additions and 1 deletions

View File

@ -4,7 +4,7 @@
Name: lldpad
Version: 1.0.1
Release: 14
Release: 15
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<zwfeng@huawei.com> - 1.0.1-15
- Type:bugfix
- Id:NA
- SUG:NA
- DESC:check the return value of ecp_create
* Wed Sep 30 2020 wangxiaopeng <wangxiaopeng7@huawei.com> - 1.0.1-14
- Type:CVE
- Id:CVE-2018-10932

View File

@ -0,0 +1,29 @@
From 488051ae0b88b8b77081fadff8154dbd4ddfd54c Mon Sep 17 00:00:00 2001
From: rpm-build <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