Skip to content

Commit 56d3aa8

Browse files
authored
[Low] Patch valkey for CVE-2025-49112 (#13996)
1 parent 6ce5a93 commit 56d3aa8

2 files changed

Lines changed: 31 additions & 1 deletion

File tree

SPECS/valkey/CVE-2025-49112.patch

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
From db21a4e55a3afe71923141bcbecbbc74920d5259 Mon Sep 17 00:00:00 2001
2+
From: SumitJenaHCL <v-sumitjena@microsoft.com>
3+
Date: Wed, 11 Jun 2025 11:29:35 +0530
4+
Subject: [PATCH] Patch CVE-2025-49112
5+
6+
Upstream Patch Reference: https://github.com/valkey-io/valkey/commit/374718b2a365ca69f715d542709b7d71540b1387
7+
---
8+
src/networking.c | 2 +-
9+
1 file changed, 1 insertion(+), 1 deletion(-)
10+
11+
diff --git a/src/networking.c b/src/networking.c
12+
index ab2df89..abb0126 100644
13+
--- a/src/networking.c
14+
+++ b/src/networking.c
15+
@@ -842,7 +842,7 @@ void setDeferredReply(client *c, void *node, const char *s, size_t length) {
16+
* - It has enough room already allocated
17+
* - And not too large (avoid large memmove)
18+
* - And the client is not in a pending I/O state */
19+
- if (ln->prev != NULL && (prev = listNodeValue(ln->prev)) && prev->size - prev->used > 0 &&
20+
+ if (ln->prev != NULL && (prev = listNodeValue(ln->prev)) && prev->used < prev->size &&
21+
c->io_write_state != CLIENT_PENDING_IO) {
22+
size_t len_to_copy = prev->size - prev->used;
23+
if (len_to_copy > length) len_to_copy = length;
24+
--
25+
2.48.1
26+

SPECS/valkey/valkey.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: advanced key-value store
22
Name: valkey
33
Version: 8.0.3
4-
Release: 1%{?dist}
4+
Release: 2%{?dist}
55
License: BSD
66
Vendor: Microsoft Corporation
77
Distribution: Azure Linux
@@ -10,6 +10,7 @@ URL: https://valkey.io/
1010
Source0: https://github.com/valkey-io/valkey/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
1111
Patch0: valkey-conf.patch
1212
Patch1: disable-mem-defrag-tests.patch
13+
Patch2: CVE-2025-49112.patch
1314
BuildRequires: gcc
1415
BuildRequires: make
1516
BuildRequires: openssl-devel
@@ -84,6 +85,9 @@ exit 0
8485
%config(noreplace) %attr(0640, %{name}, %{name}) %{_sysconfdir}/valkey.conf
8586

8687
%changelog
88+
* Thu Jun 12 2025 Sumit Jena <v-sumitjena@microsoft.com> - 8.0.3-2
89+
- Fix CVE-2025-49112
90+
8791
* Mon Apr 28 2025 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 8.0.3-1
8892
- Auto-upgrade to 8.0.3 - for CVE-2025-21605
8993

0 commit comments

Comments
 (0)