1 Star 0 Fork 78

Song.Gao/ceph

forked from src-openEuler/ceph 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0001-cmake-detect-and-use-sigdescr_np-if-available.patch 2.36 KB
一键复制 编辑 原始数据 按行查看 历史
chixinze 提交于 2021-07-18 17:27 . fix CVE-2020-27781
From 9b34ba1777972808ba2af0073c967dece6c70626 Mon Sep 17 00:00:00 2001
From: David Disseldorp <ddiss@suse.de>
Date: Tue, 1 Sep 2020 13:49:21 +0200
Subject: [PATCH] cmake: detect and use sigdescr_np() if available
sys_siglist is deprecated with glibc 2.32. A new thread-safe and
async-signal safe sigdescr_np() function is provided, so use it if
available.
Fixes: https://tracker.ceph.com/issues/47187
Signed-off-by: David Disseldorp <ddiss@suse.de>
(cherry picked from commit b9b6faf66ae67648626470cb4fc3f0850ac4d842)
Conflicts:
CMakeLists.txt
cmake/modules/CephChecks.cmake
- CephChecks.cmake file does not exist in nautilus; manually cherry-picked the
change in that file to top-level CMakeLists.txt
---
CMakeLists.txt | 1 +
src/global/signal_handler.h | 8 +++++---
src/include/config-h.in.cmake | 3 +++
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5b7a67bec60..bdeea6f9c7d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -105,6 +105,7 @@ CHECK_FUNCTION_EXISTS(strerror_r HAVE_Strerror_R)
CHECK_FUNCTION_EXISTS(name_to_handle_at HAVE_NAME_TO_HANDLE_AT)
CHECK_FUNCTION_EXISTS(pipe2 HAVE_PIPE2)
CHECK_FUNCTION_EXISTS(accept4 HAVE_ACCEPT4)
+CHECK_FUNCTION_EXISTS(sigdescr_np HAVE_SIGDESCR_NP)
include(CMakePushCheckState)
cmake_push_check_state(RESET)
diff --git a/src/global/signal_handler.h b/src/global/signal_handler.h
index 476724201aa..c101b2e2873 100644
--- a/src/global/signal_handler.h
+++ b/src/global/signal_handler.h
@@ -20,10 +20,12 @@
typedef void (*signal_handler_t)(int);
-#ifndef HAVE_REENTRANT_STRSIGNAL
-# define sig_str(signum) sys_siglist[signum]
-#else
+#ifdef HAVE_SIGDESCR_NP
+# define sig_str(signum) sigdescr_np(signum)
+#elif HAVE_REENTRANT_STRSIGNAL
# define sig_str(signum) strsignal(signum)
+#else
+# define sig_str(signum) sys_siglist[signum]
#endif
void install_sighandler(int signum, signal_handler_t handler, int flags);
diff --git a/src/include/config-h.in.cmake b/src/include/config-h.in.cmake
index ccce8fe0017..acced696e36 100644
--- a/src/include/config-h.in.cmake
+++ b/src/include/config-h.in.cmake
@@ -235,6 +235,9 @@
/* Define to 1 if you have sched.h. */
#cmakedefine HAVE_SCHED 1
+/* Define to 1 if you have sigdescr_np. */
+#cmakedefine HAVE_SIGDESCR_NP 1
+
/* Support SSE (Streaming SIMD Extensions) instructions */
#cmakedefine HAVE_SSE
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/the-moon-is-blue/ceph.git
git@gitee.com:the-moon-is-blue/ceph.git
the-moon-is-blue
ceph
ceph
master

搜索帮助