diff --git a/Fix-CVE-2023-45145.patch b/Fix-CVE-2023-45145.patch new file mode 100644 index 0000000000000000000000000000000000000000..f2b49d0f7304b7e7253549e14510cbe2ee46fb90 --- /dev/null +++ b/Fix-CVE-2023-45145.patch @@ -0,0 +1,54 @@ +From 5448495299f30b1560b9c827b5cbec41dc415497 Mon Sep 17 00:00:00 2001 +From: Zile Yao +Date: Wed, 20 Dec 2023 21:06:01 -0500 +Subject: [PATCH] cve + +--- + src/anet.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/src/anet.c b/src/anet.c +index a121c27..c16d569 100644 +--- a/src/anet.c ++++ b/src/anet.c +@@ -397,13 +397,16 @@ int anetUnixGenericConnect(char *err, const char *path, int flags) + return s; + } + +-static int anetListen(char *err, int s, struct sockaddr *sa, socklen_t len, int backlog) { ++static int anetListen(char *err, int s, struct sockaddr *sa, socklen_t len, int backlog, mode_t perm) { + if (bind(s,sa,len) == -1) { + anetSetError(err, "bind: %s", strerror(errno)); + close(s); + return ANET_ERR; + } + ++if (sa->sa_family == AF_LOCAL && perm) ++ chmod(((struct sockaddr_un *) sa)->sun_path, perm); ++ + if (listen(s, backlog) == -1) { + anetSetError(err, "listen: %s", strerror(errno)); + close(s); +@@ -447,7 +450,7 @@ static int _anetTcpServer(char *err, int port, char *bindaddr, int af, int backl + + if (af == AF_INET6 && anetV6Only(err,s) == ANET_ERR) goto error; + if (anetSetReuseAddr(err,s) == ANET_ERR) goto error; +- if (anetListen(err,s,p->ai_addr,p->ai_addrlen,backlog) == ANET_ERR) s = ANET_ERR; ++ if (anetListen(err,s,p->ai_addr,p->ai_addrlen,backlog, 0) == ANET_ERR) s = ANET_ERR; + goto end; + } + if (p == NULL) { +@@ -484,10 +487,8 @@ int anetUnixServer(char *err, char *path, mode_t perm, int backlog) + memset(&sa,0,sizeof(sa)); + sa.sun_family = AF_LOCAL; + strncpy(sa.sun_path,path,sizeof(sa.sun_path)-1); +- if (anetListen(err,s,(struct sockaddr*)&sa,sizeof(sa),backlog) == ANET_ERR) ++ if (anetListen(err,s,(struct sockaddr*)&sa,sizeof(sa),backlog,perm) == ANET_ERR) + return ANET_ERR; +- if (perm) +- chmod(sa.sun_path, perm); + return s; + } + +-- +1.8.3.1 diff --git a/redis6.spec b/redis6.spec index 1338dad4b4ddc21b993cc7367b7310dd2e9a2a3c..ae6241db2db3c97af5195908a2eb665cfffe22f4 100644 --- a/redis6.spec +++ b/redis6.spec @@ -6,7 +6,7 @@ %global Pname redis Name: redis6 Version: 6.2.7 -Release: 1 +Release: 2 Summary: A persistent key-value database License: BSD and MIT URL: https://redis.io @@ -22,6 +22,7 @@ Source10: https://github.com/%{Pname}/%{Pname}-doc/archive/%{doc_comm Patch0001: Modify-aarch64-architecture-jemalloc-page-size-from-from-4k-to-64k.patch Patch0002: fix-help-info.patch +Patch0003: Fix-CVE-2023-45145.patch BuildRequires: make gcc %if %{with tests} BuildRequires: procps-ng tcl @@ -82,6 +83,7 @@ tar -xvf %{SOURCE10} %patch0001 -p1 %patch0002 -p1 %endif +%patch0003 -p1 mv ../%{Pname}-doc-%{doc_commit} doc mv deps/lua/COPYRIGHT COPYRIGHT-lua mv deps/jemalloc/COPYING COPYING-jemalloc @@ -210,6 +212,9 @@ fi %{_docdir}/%{Pname} %changelog +* Fri Dec 22 2023 Zile Yao - 6.2.7-2 +- Fix CVE-2023-45145 + * Tue Jun 14 2022 yangweidong - 6.2.7-1 - Fix CVE-2022-24735 CVE-2022-24736 CVE-2021-29477 CVE-2021-32672