summaryrefslogtreecommitdiffstats
path: root/meta-oe
diff options
context:
space:
mode:
authorVijay Anusuri <vanusuri@mvista.com>2025-10-16 15:40:16 +0530
committerGyorgy Sarvari <skandigraun@gmail.com>2025-10-17 10:51:27 +0200
commitb5ec3b12ddd9a6832210149d788a194675b6a097 (patch)
treeadebf138de0007166826d6e3decb2ee65c82ce8f /meta-oe
parent537ab769aed5246ab6c4f6bd9f4c40b086b2325f (diff)
downloadmeta-openembedded-b5ec3b12ddd9a6832210149d788a194675b6a097.tar.gz
redis: Fix CVE-2025-48367
import patch from debian to fix CVE-2025-48367 Upstream-Status: Backport [import from debian redis_7.0.15-1~deb12u6.debian.tar.xz Upstream commit https://github.com/redis/redis/commit/0fe67435935cc5724ff6eb9c4ca4120c58a15765] Signed-off-by: Vijay Anusuri <vanusuri@mvista.com> Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Diffstat (limited to 'meta-oe')
-rw-r--r--meta-oe/recipes-extended/redis/redis-7.0.13/CVE-2025-48367.patch111
-rw-r--r--meta-oe/recipes-extended/redis/redis_7.0.13.bb1
2 files changed, 112 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/redis/redis-7.0.13/CVE-2025-48367.patch b/meta-oe/recipes-extended/redis/redis-7.0.13/CVE-2025-48367.patch
new file mode 100644
index 0000000000..0084eaa04a
--- /dev/null
+++ b/meta-oe/recipes-extended/redis/redis-7.0.13/CVE-2025-48367.patch
@@ -0,0 +1,111 @@
1From 0fe67435935cc5724ff6eb9c4ca4120c58a15765 Mon Sep 17 00:00:00 2001
2From: Ozan Tezcan <ozantezcan@gmail.com>
3Date: Wed, 14 May 2025 11:02:30 +0300
4Subject: [PATCH] Retry accept() even if accepted connection reports an error
5 (CVE-2025-48367)
6
7In case of accept4() returns an error, we should check errno value and
8decide if we should retry accept4() without waiting next event loop iteration.
9
10Upstream-Status: Backport [import from debian redis_7.0.15-1~deb12u6.debian.tar.xz
11Upstream commit
12https://github.com/redis/redis/commit/0fe67435935cc5724ff6eb9c4ca4120c58a15765]
13CVE: CVE-2025-48367
14Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
15---
16 src/anet.c | 24 ++++++++++++++++++++++++
17 src/anet.h | 1 +
18 src/cluster.c | 2 ++
19 src/networking.c | 6 ++++++
20 4 files changed, 33 insertions(+)
21
22diff --git a/src/anet.c b/src/anet.c
23index 10840fc..a38ab1b 100644
24--- a/src/anet.c
25+++ b/src/anet.c
26@@ -705,3 +705,27 @@ int anetSetSockMarkId(char *err, int fd, uint32_t id) {
27 return ANET_OK;
28 #endif
29 }
30+
31+/* This function must be called after accept4() fails. It returns 1 if 'err'
32+ * indicates accepted connection faced an error, and it's okay to continue
33+ * accepting next connection by calling accept4() again. Other errors either
34+ * indicate programming errors, e.g. calling accept() on a closed fd or indicate
35+ * a resource limit has been reached, e.g. -EMFILE, open fd limit has been
36+ * reached. In the latter case, caller might wait until resources are available.
37+ * See accept4() documentation for details. */
38+int anetAcceptFailureNeedsRetry(int err) {
39+ if (err == ECONNABORTED)
40+ return 1;
41+
42+#if defined(__linux__)
43+ /* For details, see 'Error Handling' section on
44+ * https://man7.org/linux/man-pages/man2/accept.2.html */
45+ if (err == ENETDOWN || err == EPROTO || err == ENOPROTOOPT ||
46+ err == EHOSTDOWN || err == ENONET || err == EHOSTUNREACH ||
47+ err == EOPNOTSUPP || err == ENETUNREACH)
48+ {
49+ return 1;
50+ }
51+#endif
52+ return 0;
53+}
54diff --git a/src/anet.h b/src/anet.h
55index ff86e20..864f756 100644
56--- a/src/anet.h
57+++ b/src/anet.h
58@@ -74,5 +74,6 @@ int anetFormatAddr(char *fmt, size_t fmt_len, char *ip, int port);
59 int anetFormatFdAddr(int fd, char *buf, size_t buf_len, int fd_to_str_type);
60 int anetPipe(int fds[2], int read_flags, int write_flags);
61 int anetSetSockMarkId(char *err, int fd, uint32_t id);
62+int anetAcceptFailureNeedsRetry(int err);
63
64 #endif
65diff --git a/src/cluster.c b/src/cluster.c
66index 70ede5c..cb37160 100644
67--- a/src/cluster.c
68+++ b/src/cluster.c
69@@ -879,6 +879,8 @@ void clusterAcceptHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
70 while(max--) {
71 cfd = anetTcpAccept(server.neterr, fd, cip, sizeof(cip), &cport);
72 if (cfd == ANET_ERR) {
73+ if (anetAcceptFailureNeedsRetry(errno))
74+ continue;
75 if (errno != EWOULDBLOCK)
76 serverLog(LL_VERBOSE,
77 "Error accepting cluster node: %s", server.neterr);
78diff --git a/src/networking.c b/src/networking.c
79index 386773e..0f9b7bf 100644
80--- a/src/networking.c
81+++ b/src/networking.c
82@@ -1366,6 +1366,8 @@ void acceptTcpHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
83 while(max--) {
84 cfd = anetTcpAccept(server.neterr, fd, cip, sizeof(cip), &cport);
85 if (cfd == ANET_ERR) {
86+ if (anetAcceptFailureNeedsRetry(errno))
87+ continue;
88 if (errno != EWOULDBLOCK)
89 serverLog(LL_WARNING,
90 "Accepting client connection: %s", server.neterr);
91@@ -1386,6 +1388,8 @@ void acceptTLSHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
92 while(max--) {
93 cfd = anetTcpAccept(server.neterr, fd, cip, sizeof(cip), &cport);
94 if (cfd == ANET_ERR) {
95+ if (anetAcceptFailureNeedsRetry(errno))
96+ continue;
97 if (errno != EWOULDBLOCK)
98 serverLog(LL_WARNING,
99 "Accepting client connection: %s", server.neterr);
100@@ -1405,6 +1409,8 @@ void acceptUnixHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
101 while(max--) {
102 cfd = anetUnixAccept(server.neterr, fd);
103 if (cfd == ANET_ERR) {
104+ if (anetAcceptFailureNeedsRetry(errno))
105+ continue;
106 if (errno != EWOULDBLOCK)
107 serverLog(LL_WARNING,
108 "Accepting client connection: %s", server.neterr);
109--
1102.25.1
111
diff --git a/meta-oe/recipes-extended/redis/redis_7.0.13.bb b/meta-oe/recipes-extended/redis/redis_7.0.13.bb
index 1c45784b6e..9e4b158b7a 100644
--- a/meta-oe/recipes-extended/redis/redis_7.0.13.bb
+++ b/meta-oe/recipes-extended/redis/redis_7.0.13.bb
@@ -26,6 +26,7 @@ SRC_URI = "http://download.redis.io/releases/${BP}.tar.gz \
26 file://CVE-2025-21605.patch \ 26 file://CVE-2025-21605.patch \
27 file://CVE-2025-27151.patch \ 27 file://CVE-2025-27151.patch \
28 file://CVE-2025-32023.patch \ 28 file://CVE-2025-32023.patch \
29 file://CVE-2025-48367.patch \
29 " 30 "
30SRC_URI[sha256sum] = "97065774d5fb8388eb0d8913458decfcb167d356e40d31dd01cd30c1cc391673" 31SRC_URI[sha256sum] = "97065774d5fb8388eb0d8913458decfcb167d356e40d31dd01cd30c1cc391673"
31 32