[packages/rsync] Rel 2. Bound aligned_i in hash_search() (upstream 9dc0ff638c).

arekm arekm at pld-linux.org
Thu Oct 29 09:05:26 CET 2026


commit eaffceeb3544242d886a135f35376e6f28debba6
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Wed Oct 28 23:48:20 2026 +0100

    Rel 2. Bound aligned_i in hash_search() (upstream 9dc0ff638c).

 rsync-hash_search-overflow.patch | 17 +++++++++++++++++
 rsync.spec                       |  4 +++-
 2 files changed, 20 insertions(+), 1 deletion(-)
---
diff --git a/rsync.spec b/rsync.spec
index a076023..c5bdc86 100644
--- a/rsync.spec
+++ b/rsync.spec
@@ -17,7 +17,7 @@ Summary(zh_CN.UTF-8):	[通讯]传输工具
 Summary(zh_TW.UTF-8):	[喙啪]$(B6G?i火(c(B
 Name:		rsync
 Version:	3.5.1
-Release:	1
+Release:	2
 Epoch:		1
 License:	GPL v3+
 Group:		Networking/Utilities
@@ -30,6 +30,7 @@ Source5:	%{name}d.logrotate
 Source6:	%{name}.tmpfiles
 Patch0:		%{name}-config.patch
 Patch1:         rsync-norandomfailure.patch
+Patch2:		%{name}-hash_search-overflow.patch
 URL:		https://rsync.samba.org/
 BuildRequires:	acl-devel
 BuildRequires:	autoconf >= 2.69
@@ -171,6 +172,7 @@ techniczna nowego algorytmu została również dołączona do pakietu.
 %setup -q
 %patch -P0 -p1
 %patch -P1 -p1
+%patch -P2 -p1
 
 sed -i -e 's|#!/usr/bin/env bash|#!/bin/bash|' rsync-ssl
 
diff --git a/rsync-hash_search-overflow.patch b/rsync-hash_search-overflow.patch
new file mode 100644
index 0000000..4896957
--- /dev/null
+++ b/rsync-hash_search-overflow.patch
@@ -0,0 +1,17 @@
+Bound aligned_i in hash_search(): a malicious peer with tiny blength/count makes it
+overflow past INT32_MAX on --inplace >2 GiB files -> negative s->sums[] index.
+https://github.com/RsyncProject/rsync/commit/9dc0ff638c
+
+diff --git a/match.c b/match.c
+index 4fa3b8599..62029208d 100644
+--- a/match.c
++++ b/match.c
+@@ -277,7 +277,7 @@ static void hash_search(int f,struct sum_struct *s,
+ 			 * the adjacent want_i optimization. */
+ 			if (updating_basis_file) {
+ 				/* All the generator's chunks start at blength boundaries. */
+-				while (aligned_offset < offset) {
++				while (aligned_offset < offset && aligned_i < s->count) {
+ 					aligned_offset += s->blength;
+ 					aligned_i++;
+ 				}
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rsync.git/commitdiff/eaffceeb3544242d886a135f35376e6f28debba6



More information about the pld-cvs-commit mailing list