1
0
forked from rpms/rsync

Resolves: #2053198 - rsync segmentation fault

This commit is contained in:
Michal Ruprich 2022-04-26 08:31:05 +02:00
parent ec38219bd3
commit c67a2467e5
3 changed files with 33 additions and 1 deletions

3
rpminspect.yaml Normal file
View File

@ -0,0 +1,3 @@
---
inspections:
badfuncs: off

View File

@ -0,0 +1,24 @@
From f5a9a1013873580d0ad2ae4f5c5038c324d71bfe Mon Sep 17 00:00:00 2001
From: Wayne Davison <wayne@opencoder.net>
Date: Mon, 21 Feb 2022 14:19:31 -0800
Subject: [PATCH] Fix possible array deref using invalid index.
---
copy-devices.diff | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/patches/copy-devices.diff b/patches/copy-devices.diff
index 797d046..4138474 100644
--- a/patches/copy-devices.diff
+++ b/patches/copy-devices.diff
@@ -111,8 +111,8 @@ diff --git a/rsync.c b/rsync.c
if (iflags & ITEM_TRANSFER) {
int i = ndx - cur_flist->ndx_start;
- if (i < 0 || !S_ISREG(cur_flist->files[i]->mode)) {
-+ struct file_struct *file = cur_flist->files[i];
-+ if (i < 0 || !(S_ISREG(file->mode) || (copy_devices && IS_DEVICE(file->mode)))) {
++ if (i < 0
++ || !(S_ISREG(cur_flist->files[i]->mode) || (copy_devices && IS_DEVICE(cur_flist->files[i]->mode)))) {
rprintf(FERROR,
"received request to transfer non-regular file: %d [%s]\n",
ndx, who_am_i());

View File

@ -10,7 +10,7 @@
Summary: A program for synchronizing files over a network Summary: A program for synchronizing files over a network
Name: rsync Name: rsync
Version: 3.2.3 Version: 3.2.3
Release: 10%{?dist} Release: 11%{?dist}
URL: https://rsync.samba.org/ URL: https://rsync.samba.org/
Source0: https://download.samba.org/pub/rsync/src/rsync-%{version}%{?prerelease}.tar.gz Source0: https://download.samba.org/pub/rsync/src/rsync-%{version}%{?prerelease}.tar.gz
@ -36,6 +36,7 @@ Patch1: rsync-3.2.2-runtests.patch
Patch2: rsync-3.2.3-lchmod.patch Patch2: rsync-3.2.3-lchmod.patch
Patch3: rsync-3.2.3-append-mode.patch Patch3: rsync-3.2.3-append-mode.patch
Patch4: rsync-3.2.3-xattr.patch Patch4: rsync-3.2.3-xattr.patch
Patch5: rsync-3.2.3-segfault.patch
%description %description
Rsync uses a reliable algorithm to bring remote and host files into Rsync uses a reliable algorithm to bring remote and host files into
@ -74,6 +75,7 @@ patch -p1 -i patches/copy-devices.diff
%patch2 -p1 -b .lchmod %patch2 -p1 -b .lchmod
%patch3 -p1 -b .append-mode %patch3 -p1 -b .append-mode
%patch4 -p1 -b .xattr %patch4 -p1 -b .xattr
%patch5 -p1 -b .segfault
%build %build
%configure --disable-xxhash %configure --disable-xxhash
@ -120,6 +122,9 @@ install -D -m644 %{SOURCE6} $RPM_BUILD_ROOT/%{_unitdir}/rsyncd@.service
%systemd_postun_with_restart rsyncd.service %systemd_postun_with_restart rsyncd.service
%changelog %changelog
* Tue Apr 26 2022 Michal Ruprich <mruprich@redhat.com> - 3.2.3-11
- Resolves: #2053198 - rsync segmentation fault
* Fri Apr 22 2022 Michal Ruprich <mruprich@redhat.com> - 3.2.3-10 * Fri Apr 22 2022 Michal Ruprich <mruprich@redhat.com> - 3.2.3-10
- Resolves: #2077431 - Read-only files that have changed xattrs fail to allow xattr changes - Resolves: #2077431 - Read-only files that have changed xattrs fail to allow xattr changes