Browse code

rsync : Updated to version 3.1.3, fix CVE-2018-5764

Change-Id: I6e0a2156672dae7d357276b4673d96d81b215815
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/5106
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Sharath George

Xiaolin Li authored on 2018/05/02 02:58:19
Showing 5 changed files
1 1
deleted file mode 100644
... ...
@@ -1,28 +0,0 @@
1
-From 47a63d90e71d3e19e0e96052bb8c6b9cb140ecc1 Mon Sep 17 00:00:00 2001
2
-From: Wayne Davison <wayned@samba.org>
3
-Date: Sun, 5 Nov 2017 11:33:15 -0800
4
-Subject: [PATCH] Enforce trailing \0 when receiving xattr name values. Fixes
5
- bug 13112.
6
-
7
- xattrs.c | 4 ++++
8
- 1 file changed, 4 insertions(+)
9
-
10
-diff --git a/xattrs.c b/xattrs.c
11
-index 68305d7..4867e6f 100644
12
-+++ b/xattrs.c
13
-@@ -824,6 +824,10 @@ void receive_xattr(int f, struct file_struct *file)
14
- 			out_of_memory("receive_xattr");
15
- 		name = ptr + dget_len + extra_len;
16
- 		read_buf(f, name, name_len);
17
-+		if (name_len < 1 || name[name_len-1] != '\0') {
18
-+			rprintf(FERROR, "Invalid xattr name received (missing trailing \\0).\n");
19
-+			exit_cleanup(RERR_FILEIO);
20
-+		}
21
- 		if (dget_len == datum_len)
22
- 			read_buf(f, ptr, dget_len);
23
- 		else {
24
-1.9.1
25
-
26 1
deleted file mode 100644
... ...
@@ -1,42 +0,0 @@
1
-From 3e06d40029cfdce9d0f73d87cfd4edaf54be9c51 Mon Sep 17 00:00:00 2001
2
-From: Jeriko One <jeriko.one@gmx.us>
3
-Date: Thu, 2 Nov 2017 23:44:19 -0700
4
-Subject: [PATCH] Check fname in recv_files sooner.
5
-
6
- receiver.c | 12 ++++++------
7
- 1 file changed, 6 insertions(+), 6 deletions(-)
8
-
9
-diff --git a/receiver.c b/receiver.c
10
-index baae3a9..9fdafa1 100644
11
-+++ b/receiver.c
12
-@@ -574,6 +574,12 @@ int recv_files(int f_in, int f_out, char *local_name)
13
- 			file = dir_flist->files[cur_flist->parent_ndx];
14
- 		fname = local_name ? local_name : f_name(file, fbuf);
15
- 
16
-+		if (daemon_filter_list.head
17
-+		    && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0) {
18
-+			rprintf(FERROR, "attempt to hack rsync failed.\n");
19
-+			exit_cleanup(RERR_PROTOCOL);
20
-+		}
21
-+
22
- 		if (DEBUG_GTE(RECV, 1))
23
- 			rprintf(FINFO, "recv_files(%s)\n", fname);
24
- 
25
-@@ -645,12 +651,6 @@ int recv_files(int f_in, int f_out, char *local_name)
26
- 
27
- 		cleanup_got_literal = 0;
28
- 
29
--		if (daemon_filter_list.head
30
--		    && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0) {
31
--			rprintf(FERROR, "attempt to hack rsync failed.\n");
32
--			exit_cleanup(RERR_PROTOCOL);
33
--		}
34
--
35
- 		if (read_batch) {
36
- 			int wanted = redoing
37
- 				   ? we_want_redo(ndx)
38
-1.9.1
39
-
40 1
deleted file mode 100644
... ...
@@ -1,25 +0,0 @@
1
-From 5509597decdbd7b91994210f700329d8a35e70a1 Mon Sep 17 00:00:00 2001
2
-From: Jeriko One <jeriko.one@gmx.us>
3
-Date: Thu, 16 Nov 2017 17:26:03 -0800
4
-Subject: [PATCH] Check daemon filter against fnamecmp in recv_files().
5
-
6
- receiver.c | 2 +-
7
- 1 file changed, 1 insertion(+), 1 deletion(-)
8
-
9
-diff --git a/receiver.c b/receiver.c
10
-index 9fdafa1..9c46242 100644
11
-+++ b/receiver.c
12
-@@ -722,7 +722,7 @@ int recv_files(int f_in, int f_out, char *local_name)
13
- 				break;
14
- 			}
15
- 			if (!fnamecmp || (daemon_filter_list.head
16
--			  && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0)) {
17
-+			  && check_filter(&daemon_filter_list, FLOG, fnamecmp, 0) < 0)) {
18
- 				fnamecmp = fname;
19
- 				fnamecmp_type = FNAMECMP_FNAME;
20
- 			}
21
-1.9.1
22
-
23 1
deleted file mode 100644
... ...
@@ -1,36 +0,0 @@
1
-From 70aeb5fddd1b2f8e143276f8d5a085db16c593b9 Mon Sep 17 00:00:00 2001
2
-From: Jeriko One <jeriko.one@gmx.us>
3
-Date: Thu, 16 Nov 2017 17:05:42 -0800
4
-Subject: [PATCH] Sanitize xname in read_ndx_and_attrs.
5
-
6
- rsync.c | 6 ++++++
7
- 1 file changed, 6 insertions(+)
8
-
9
-diff --git a/rsync.c b/rsync.c
10
-index b82e598..a0945ba 100644
11
-+++ b/rsync.c
12
-@@ -49,6 +49,7 @@ extern int flist_eof;
13
- extern int file_old_total;
14
- extern int keep_dirlinks;
15
- extern int make_backups;
16
-+extern int sanitize_paths;
17
- extern struct file_list *cur_flist, *first_flist, *dir_flist;
18
- extern struct chmod_mode_struct *daemon_chmod_modes;
19
- #ifdef ICONV_OPTION
20
-@@ -396,6 +397,11 @@ int read_ndx_and_attrs(int f_in, int f_out, int *iflag_ptr, uchar *type_ptr,
21
- 	if (iflags & ITEM_XNAME_FOLLOWS) {
22
- 		if ((len = read_vstring(f_in, buf, MAXPATHLEN)) < 0)
23
- 			exit_cleanup(RERR_PROTOCOL);
24
-+
25
-+		if (sanitize_paths) {
26
-+			sanitize_path(buf, buf, "", 0, SP_DEFAULT);
27
-+			len = strlen(buf);
28
-+		}
29
- 	} else {
30
- 		*buf = '\0';
31
- 		len = -1;
32
-1.9.1
33
-
... ...
@@ -1,15 +1,11 @@
1 1
 Summary:        Fast incremental file transfer. 
2 2
 Name:           rsync
3
-Version:        3.1.2
4
-Release:        4%{?dist}
3
+Version:        3.1.3
4
+Release:        1%{?dist}
5 5
 License:        GPLv3+
6 6
 URL:            https://rsync.samba.org/
7 7
 Source0:        https://download.samba.org/pub/rsync/src/%{name}-%{version}.tar.gz
8
-%define sha1    rsync=0d4c7fb7fe3fc80eeff922a7c1d81df11dbb8a1a
9
-Patch0:         rsync-CVE-2017-16548.patch
10
-Patch1:         rsync-CVE-2017-17433.patch
11
-Patch2:         rsync-CVE-2017-17434-1.patch
12
-Patch3:         rsync-CVE-2017-17434-2.patch
8
+%define sha1    rsync=82e7829c0b3cefbd33c233005341e2073c425629
13 9
 Group:          Appication/Internet
14 10
 Vendor:         VMware, Inc.
15 11
 Distribution:   Photon
... ...
@@ -19,10 +15,6 @@ Requires:       systemd
19 19
 Rsync is a fast and extraordinarily versatile file copying tool. It can copy locally, to/from another host over any remote shell, or to/from a remote rsync daemon. It offers a large number of options that control every aspect of its behavior and permit very flexible specification of the set of files to be copied. It is famous for its delta-transfer algorithm, which reduces the amount of data sent over the network by sending only the differences between the source files and the existing files in the destination. Rsync is widely used for backups and mirroring and as an improved copy command for everyday use.
20 20
 %prep
21 21
 %setup -q
22
-%patch0 -p1
23
-%patch1 -p1
24
-%patch2 -p1
25
-%patch3 -p1
26 22
 %build
27 23
 %configure --prefix=/usr
28 24
 make %{?_smp_mflags}
... ...
@@ -59,6 +51,8 @@ EOF
59 59
 %{_libdir}/systemd/system/rsyncd.service
60 60
 %{_sysconfdir}/rsyncd.conf
61 61
 %changelog
62
+*   Tue May 01 2018 Xiaolin Li <xiaolinl@vmware.com> 3.1.3-1
63
+-   Updated to version 3.1.3, fix CVE-2018-5764
62 64
 *   Wed Dec 27 2017 Xiaolin Li <xiaolinl@vmware.com> 3.1.2-4
63 65
 -   Fix CVE-2017-17433, CVE-2017-17434
64 66
 *   Wed Nov 29 2017 Xiaolin Li <xiaolinl@vmware.com> 3.1.2-3