From 51adef16b6a3523de2b2ecb727b0fa23a4d32921 Mon Sep 17 00:00:00 2001 From: kircher Date: Fri, 23 Dec 2022 17:05:34 +0800 Subject: [PATCH] sync fix null pointer deref in stack_broadcast_close (cherry picked from commit 45eeca7192120cd390ccdb9873a93c0eb231fd9e) --- 0179-fix-lstack-Makefile-warning.patch | 31 +++++++++++++++++++ ...inter-deref-in-stack_broadcast_close.patch | 25 +++++++++++++++ gazelle.spec | 8 ++++- 3 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 0179-fix-lstack-Makefile-warning.patch create mode 100644 0180-fix-null-pointer-deref-in-stack_broadcast_close.patch diff --git a/0179-fix-lstack-Makefile-warning.patch b/0179-fix-lstack-Makefile-warning.patch new file mode 100644 index 0000000..5490d24 --- /dev/null +++ b/0179-fix-lstack-Makefile-warning.patch @@ -0,0 +1,31 @@ +From 3564b6cc6405b75864c133f419cf8c3771810f22 Mon Sep 17 00:00:00 2001 +From: wu-changsheng +Date: Thu, 22 Dec 2022 10:31:32 +0800 +Subject: [PATCH] fix lstack Makefile warning + +--- + src/lstack/Makefile | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/lstack/Makefile b/src/lstack/Makefile +index b6cbd32..d56fd65 100644 +--- a/src/lstack/Makefile ++++ b/src/lstack/Makefile +@@ -21,11 +21,12 @@ OPTIMIZATION = -O2 -g + RM = rm -f + LDFLAGS = -shared -ldl -lm -lpthread -lrt -lnuma -lconfig -lboundscheck + +-ifeq ($(CC),gcc) ++ifneq ($(CC),clang) + SEC_FLAGS = -fstack-protector-strong -Werror -Wall -Wl,-z,relro, -Wl,-z,now -Wl,-z,noexecstack -Wtrampolines -fPIC -D_FORTIFY_SOURCE=2 +-else ifeq($(CC),clang) ++else + SEC_FLAGS = -fstack-protector-strong -Werror -Wall -fPIC + endif ++$(info $(CC):$(SEC_FLAGS)) + + INC = -I$(LSTACK_DIR)/include \ + -I$(LSTACK_DIR)/../common \ +-- +2.33.0 + diff --git a/0180-fix-null-pointer-deref-in-stack_broadcast_close.patch b/0180-fix-null-pointer-deref-in-stack_broadcast_close.patch new file mode 100644 index 0000000..fced0ca --- /dev/null +++ b/0180-fix-null-pointer-deref-in-stack_broadcast_close.patch @@ -0,0 +1,25 @@ +From 09c62a8577c340c0254c42bc57c0d193704aa169 Mon Sep 17 00:00:00 2001 +From: kircher +Date: Fri, 23 Dec 2022 11:50:05 +0800 +Subject: [PATCH] fix null pointer deref in stack_broadcast_close + +--- + src/lstack/core/lstack_protocol_stack.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/lstack/core/lstack_protocol_stack.c b/src/lstack/core/lstack_protocol_stack.c +index 7b53b91..9cc8946 100644 +--- a/src/lstack/core/lstack_protocol_stack.c ++++ b/src/lstack/core/lstack_protocol_stack.c +@@ -783,7 +783,7 @@ int32_t stack_broadcast_close(int32_t fd) + ret = -1; + } + +- if (sock == NULL) { ++ if (sock == NULL || sock->conn == NULL) { + break; + } + fd = sock->conn->socket; +-- +2.33.0 + diff --git a/gazelle.spec b/gazelle.spec index 9685fd6..2a16500 100644 --- a/gazelle.spec +++ b/gazelle.spec @@ -2,7 +2,7 @@ Name: gazelle Version: 1.0.1 -Release: 42 +Release: 43 Summary: gazelle is a high performance user-mode stack License: MulanPSL-2.0 URL: https://gitee.com/openeuler/gazelle @@ -193,6 +193,8 @@ Patch9175: 0175-add-rcv-nxt-dfx-info.patch Patch9176: 0176-mbuf-private-data-size-align-cache-line.patch Patch9177: 0177-fix-send-pkts-bluk-err.patch Patch9178: 0178-free-recv-pkts-bluks.patch +Patch9179: 0179-fix-lstack-Makefile-warning.patch +Patch9180: 0180-fix-null-pointer-deref-in-stack_broadcast_close.patch %description %{name} is a high performance user-mode stack. @@ -233,6 +235,10 @@ install -Dpm 0640 %{_builddir}/%{name}-%{version}/src/ltran/ltran.conf %{b %config(noreplace) %{conf_path}/ltran.conf %changelog +* Fri Dec 23 2022 kircher - 1.0.1-43 +- fix null pointer deref in stack_broadcast_close +- fix lstack Makefile warning + * Thu Dec 22 2022 wuchangsheng - 1.0.1-42 - add dfx rcv_nxt info mbuf private cache line align