bugfix: fix memery errors detected by cooddy
(cherry picked from commit 2e88021dd3023ae87fd8b57345447f8ca9e5ed83)
This commit is contained in:
parent
1b8aab696f
commit
2e2145bdbc
@ -0,0 +1,25 @@
|
|||||||
|
From d451214b0761977f016ef0d7b248847d5cc643f5 Mon Sep 17 00:00:00 2001
|
||||||
|
From: yinbin <yinbin8@huawei.com>
|
||||||
|
Date: Sat, 12 Oct 2024 17:36:27 +0800
|
||||||
|
Subject: [PATCH 1/3] IPV6: Enable IPV6_FRAG_COPYHEADER macro to adapt 64bit
|
||||||
|
env
|
||||||
|
|
||||||
|
---
|
||||||
|
src/include/lwipopts.h | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
diff --git a/src/include/lwipopts.h b/src/include/lwipopts.h
|
||||||
|
index c3ecb21..c46dce9 100644
|
||||||
|
--- a/src/include/lwipopts.h
|
||||||
|
+++ b/src/include/lwipopts.h
|
||||||
|
@@ -187,6 +187,7 @@
|
||||||
|
#define LWIP_IPV6 1
|
||||||
|
#define IP6_HLEN 40
|
||||||
|
#define LWIP_IPV6_SCOPES 1
|
||||||
|
+#define IPV6_FRAG_COPYHEADER 1
|
||||||
|
|
||||||
|
/*
|
||||||
|
---------------------------------
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
From 99400e4659fbd84adecdf621f213e0f7f329556c Mon Sep 17 00:00:00 2001
|
||||||
|
From: yinbin <yinbin8@huawei.com>
|
||||||
|
Date: Mon, 14 Oct 2024 09:19:26 +0800
|
||||||
|
Subject: [PATCH 2/3] IPV6: fix array out of bounds in function ip6_ntoa_r
|
||||||
|
|
||||||
|
---
|
||||||
|
src/core/ipv6/ip6_addr.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/core/ipv6/ip6_addr.c b/src/core/ipv6/ip6_addr.c
|
||||||
|
index 6e0ac86..dfcc5b1 100644
|
||||||
|
--- a/src/core/ipv6/ip6_addr.c
|
||||||
|
+++ b/src/core/ipv6/ip6_addr.c
|
||||||
|
@@ -278,7 +278,7 @@ ip6addr_ntoa_r(const ip6_addr_t *addr, char *buf, int buflen)
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
- if (empty_block_flag == 0) {
|
||||||
|
+ if (empty_block_flag == 0 && current_block_value < 7) {
|
||||||
|
/* generate empty block "::", but only if more than one contiguous zero block,
|
||||||
|
* according to current formatting suggestions RFC 5952. */
|
||||||
|
next_block_value = lwip_htonl(addr->addr[(current_block_index + 1) >> 1]);
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
43
0172-IPV6-add-group-check-while-mld6-schedule-a-report.patch
Normal file
43
0172-IPV6-add-group-check-while-mld6-schedule-a-report.patch
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
From c73d8f324d14c2433d2a59724c2ea4ff7a9ea979 Mon Sep 17 00:00:00 2001
|
||||||
|
From: yinbin <yinbin8@huawei.com>
|
||||||
|
Date: Mon, 14 Oct 2024 15:45:07 +0800
|
||||||
|
Subject: [PATCH] IPV6: add group check while mld6 schedule a report
|
||||||
|
|
||||||
|
---
|
||||||
|
src/core/ipv6/mld6.c | 12 ++++++++----
|
||||||
|
1 file changed, 8 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/core/ipv6/mld6.c b/src/core/ipv6/mld6.c
|
||||||
|
index 3aecb35..ffa2faf 100644
|
||||||
|
--- a/src/core/ipv6/mld6.c
|
||||||
|
+++ b/src/core/ipv6/mld6.c
|
||||||
|
@@ -292,11 +292,14 @@ mld6_input(struct pbuf *p, struct netif *inp)
|
||||||
|
ip6_addr_copy(group_addr, mld_v2_hdr->multicast_address);
|
||||||
|
group = mld6_lookfor_group(inp, &group_addr);
|
||||||
|
|
||||||
|
+ if (group == NULL) {
|
||||||
|
+ MLD6_STATS_INC(mld6.drop);
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (0 == src_num) {
|
||||||
|
- if (group != NULL) {
|
||||||
|
- /* Schedule a report. */
|
||||||
|
- mld6_v2_delayed_report(group, lwip_ntohs(mld_v2_hdr->max_resp_delay));
|
||||||
|
- }
|
||||||
|
+ /* Schedule a report. */
|
||||||
|
+ mld6_v2_delayed_report(group, lwip_ntohs(mld_v2_hdr->max_resp_delay));
|
||||||
|
} else {
|
||||||
|
src_buf = (ip6_addr_p_t *)mem_malloc(src_buf_size);
|
||||||
|
if (src_buf == NULL) {
|
||||||
|
@@ -310,6 +313,7 @@ mld6_input(struct pbuf *p, struct netif *inp)
|
||||||
|
/* We interest! */
|
||||||
|
mld6_v2_delayed_report(group, lwip_ntohs(mld_v2_hdr->max_resp_delay));
|
||||||
|
}
|
||||||
|
+ mem_free(src_buf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
10
lwip.spec
10
lwip.spec
@ -4,7 +4,7 @@
|
|||||||
Summary: lwip is a small independent implementation of the TCP/IP protocol suite
|
Summary: lwip is a small independent implementation of the TCP/IP protocol suite
|
||||||
Name: lwip
|
Name: lwip
|
||||||
Version: 2.2.0
|
Version: 2.2.0
|
||||||
Release: 59
|
Release: 60
|
||||||
License: BSD
|
License: BSD
|
||||||
URL: http://savannah.nongnu.org/projects/lwip/
|
URL: http://savannah.nongnu.org/projects/lwip/
|
||||||
Source0: http://download.savannah.nongnu.org/releases/lwip/%{name}-%{version}.zip
|
Source0: http://download.savannah.nongnu.org/releases/lwip/%{name}-%{version}.zip
|
||||||
@ -181,6 +181,9 @@ Patch9165: 0166-cleancode-rename-log-level.patch
|
|||||||
Patch9166: 0167-lwip-add-pingpong-mode-support.patch
|
Patch9166: 0167-lwip-add-pingpong-mode-support.patch
|
||||||
Patch9167: 0168-lwip-adapt-interrupt-mode.patch
|
Patch9167: 0168-lwip-adapt-interrupt-mode.patch
|
||||||
Patch9168: 0169-pingpong-fix-send-dup-ack.patch
|
Patch9168: 0169-pingpong-fix-send-dup-ack.patch
|
||||||
|
Patch9169: 0170-IPV6-Enable-IPV6_FRAG_COPYHEADER-macro-to-adapt-64bi.patch
|
||||||
|
Patch9170: 0171-IPV6-fix-array-out-of-bounds-in-function-ip6_ntoa_r.patch
|
||||||
|
Patch9171: 0172-IPV6-add-group-check-while-mld6-schedule-a-report.patch
|
||||||
|
|
||||||
BuildRequires: gcc-c++ dos2unix dpdk-devel
|
BuildRequires: gcc-c++ dos2unix dpdk-devel
|
||||||
|
|
||||||
@ -210,6 +213,11 @@ cd %{_builddir}/%{name}-%{version}/src
|
|||||||
%{_libdir}/liblwip.a
|
%{_libdir}/liblwip.a
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Oct 14 2024 yinbin <yinbin8@huawei.com> - 2.2.0-60
|
||||||
|
- IPV6: Enable IPV6_FRAG_COPYHEADER macro to adapt 64bit
|
||||||
|
- IPV6: fix array out of bounds in function ip6_ntoa_r
|
||||||
|
- IPV6: add group check while mld6 schedule a report
|
||||||
|
|
||||||
* Mon Sep 30 2024 jiangheng <jiangheng14@huawei.com> - 2.2.0-59
|
* Mon Sep 30 2024 jiangheng <jiangheng14@huawei.com> - 2.2.0-59
|
||||||
- pingpong: fix send dup ack in fast timer
|
- pingpong: fix send dup ack in fast timer
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user