From c67a2467e58c05baaf47f84ecb77bf37a740a9ad Mon Sep 17 00:00:00 2001 From: Michal Ruprich Date: Tue, 26 Apr 2022 08:31:05 +0200 Subject: [PATCH] Resolves: #2053198 - rsync segmentation fault --- rpminspect.yaml | 3 +++ rsync-3.2.3-segfault.patch | 24 ++++++++++++++++++++++++ rsync.spec | 7 ++++++- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 rpminspect.yaml create mode 100644 rsync-3.2.3-segfault.patch diff --git a/rpminspect.yaml b/rpminspect.yaml new file mode 100644 index 0000000..0c3bdf7 --- /dev/null +++ b/rpminspect.yaml @@ -0,0 +1,3 @@ +--- +inspections: + badfuncs: off diff --git a/rsync-3.2.3-segfault.patch b/rsync-3.2.3-segfault.patch new file mode 100644 index 0000000..7240f6a --- /dev/null +++ b/rsync-3.2.3-segfault.patch @@ -0,0 +1,24 @@ +From f5a9a1013873580d0ad2ae4f5c5038c324d71bfe Mon Sep 17 00:00:00 2001 +From: Wayne Davison +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()); diff --git a/rsync.spec b/rsync.spec index e3f5853..a8b11ae 100644 --- a/rsync.spec +++ b/rsync.spec @@ -10,7 +10,7 @@ Summary: A program for synchronizing files over a network Name: rsync Version: 3.2.3 -Release: 10%{?dist} +Release: 11%{?dist} URL: https://rsync.samba.org/ 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 Patch3: rsync-3.2.3-append-mode.patch Patch4: rsync-3.2.3-xattr.patch +Patch5: rsync-3.2.3-segfault.patch %description 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 %patch3 -p1 -b .append-mode %patch4 -p1 -b .xattr +%patch5 -p1 -b .segfault %build %configure --disable-xxhash @@ -120,6 +122,9 @@ install -D -m644 %{SOURCE6} $RPM_BUILD_ROOT/%{_unitdir}/rsyncd@.service %systemd_postun_with_restart rsyncd.service %changelog +* Tue Apr 26 2022 Michal Ruprich - 3.2.3-11 +- Resolves: #2053198 - rsync segmentation fault + * Fri Apr 22 2022 Michal Ruprich - 3.2.3-10 - Resolves: #2077431 - Read-only files that have changed xattrs fail to allow xattr changes