!242 [sync] PR-238: fix null pointer deref in stack_broadcast_close - fix lstack Makefile warning

From: @openeuler-sync-bot 
Reviewed-by: @wu-changsheng 
Signed-off-by: @wu-changsheng
This commit is contained in:
openeuler-ci-bot 2022-12-24 03:26:13 +00:00 committed by Gitee
commit b7ace2d34c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 63 additions and 1 deletions

View File

@ -0,0 +1,31 @@
From 3564b6cc6405b75864c133f419cf8c3771810f22 Mon Sep 17 00:00:00 2001
From: wu-changsheng <wuchangsheng2@huawei.com>
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

View File

@ -0,0 +1,25 @@
From 09c62a8577c340c0254c42bc57c0d193704aa169 Mon Sep 17 00:00:00 2001
From: kircher <majun65@huawei.com>
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

View File

@ -2,7 +2,7 @@
Name: gazelle
Version: 1.0.1
Release: 40
Release: 41
Summary: gazelle is a high performance user-mode stack
License: MulanPSL-2.0
URL: https://gitee.com/openeuler/gazelle
@ -188,6 +188,8 @@ Patch9170: 0170-add-rcv-nxt-dfx-info.patch
Patch9171: 0171-mbuf-private-data-size-align-cache-line.patch
Patch9172: 0172-fix-send-pkts-bluk-err.patch
Patch9173: 0173-free-recv-pkts-bluks.patch
Patch9174: 0174-fix-lstack-Makefile-warning.patch
Patch9175: 0175-fix-null-pointer-deref-in-stack_broadcast_close.patch
%description
%{name} is a high performance user-mode stack.
@ -228,6 +230,10 @@ install -Dpm 0640 %{_builddir}/%{name}-%{version}/src/ltran/ltran.conf %{b
%config(noreplace) %{conf_path}/ltran.conf
%changelog
* Fri Dec 23 2022 kircher <majun65@huawei.com> - 1.0.1-41
- fix null pointer deref in stack_broadcast_close
- fix lstack Makefile warning
* Thu Dec 22 2022 wuchangsheng <wuchangsheng2@huawei.com> - 1.0.1-40
- add dfx rcv_nxt info
mbuf private cache line align