From owner-svn-ports-head@freebsd.org Wed Dec 20 14:18:22 2017 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6FBBE8B9B1; Wed, 20 Dec 2017 14:18:22 +0000 (UTC) (envelope-from ehaupt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 761086F37F; Wed, 20 Dec 2017 14:18:22 +0000 (UTC) (envelope-from ehaupt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBKEIL3G058180; Wed, 20 Dec 2017 14:18:21 GMT (envelope-from ehaupt@FreeBSD.org) Received: (from ehaupt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBKEILut058175; Wed, 20 Dec 2017 14:18:21 GMT (envelope-from ehaupt@FreeBSD.org) Message-Id: <201712201418.vBKEILut058175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ehaupt set sender to ehaupt@FreeBSD.org using -f From: Emanuel Haupt Date: Wed, 20 Dec 2017 14:18:21 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r456798 - in head/net/rsync: . files X-SVN-Group: ports-head X-SVN-Commit-Author: ehaupt X-SVN-Commit-Paths: in head/net/rsync: . files X-SVN-Commit-Revision: 456798 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 14:18:22 -0000 Author: ehaupt Date: Wed Dec 20 14:18:20 2017 New Revision: 456798 URL: https://svnweb.freebsd.org/changeset/ports/456798 Log: - Add patches [1] to fix following security vulnerabilities: * CVE-2017-16548 * CVE-2017-17433 * CVE-2017-17434 - Bump PORTREVISION - Move position of PORTREVISION in Makefile to fix portlint warning PR: 224477 Submitted by: yasu@utahime.org Obtained from: debian MFH: 2017Q4 (blanket) Added: head/net/rsync/files/patch-CVE-2017-16548 (contents, props changed) head/net/rsync/files/patch-CVE-2017-17433 (contents, props changed) head/net/rsync/files/patch-CVE-2017-17434-1 (contents, props changed) head/net/rsync/files/patch-CVE-2017-17434-2 (contents, props changed) Modified: head/net/rsync/Makefile Modified: head/net/rsync/Makefile ============================================================================== --- head/net/rsync/Makefile Wed Dec 20 14:16:29 2017 (r456797) +++ head/net/rsync/Makefile Wed Dec 20 14:18:20 2017 (r456798) @@ -3,8 +3,8 @@ PORTNAME= rsync PORTVERSION= 3.1.2 +PORTREVISION= 8 CATEGORIES= net ipv6 -PORTREVISION= 7 MASTER_SITES= http://rsync.samba.org/ftp/rsync/ \ https://rsync.samba.org/ftp/rsync/ \ ftp://ftp.fu-berlin.de/pub/unix/network/rsync/ \ Added: head/net/rsync/files/patch-CVE-2017-16548 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/rsync/files/patch-CVE-2017-16548 Wed Dec 20 14:18:20 2017 (r456798) @@ -0,0 +1,31 @@ +From: Wayne Davison +Date: Sun, 5 Nov 2017 11:33:15 -0800 +Subject: Enforce trailing \0 when receiving xattr name values. Fixes bug + 13112. +Origin: https://git.samba.org/rsync.git/?p=rsync.git;a=commit;h=47a63d90e71d3e19e0e96052bb8c6b9cb140ecc1 +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13112 +Bug-Debian: https://bugs.debian.org/880954 +Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2017-16548 + +--- + xattrs.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/xattrs.c b/xattrs.c +index 68305d75..4867e6f5 100644 +--- a/xattrs.c ++++ b/xattrs.c +@@ -824,6 +824,10 @@ void receive_xattr(int f, struct file_struct *file) + out_of_memory("receive_xattr"); + name = ptr + dget_len + extra_len; + read_buf(f, name, name_len); ++ if (name_len < 1 || name[name_len-1] != '\0') { ++ rprintf(FERROR, "Invalid xattr name received (missing trailing \\0).\n"); ++ exit_cleanup(RERR_FILEIO); ++ } + if (dget_len == datum_len) + read_buf(f, ptr, dget_len); + else { +-- +2.15.1 + Added: head/net/rsync/files/patch-CVE-2017-17433 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/rsync/files/patch-CVE-2017-17433 Wed Dec 20 14:18:20 2017 (r456798) @@ -0,0 +1,44 @@ +From: Jeriko One +Date: Thu, 2 Nov 2017 23:44:19 -0700 +Subject: Check fname in recv_files sooner. +Origin: https://git.samba.org/?p=rsync.git;a=commit;h=3e06d40029cfdce9d0f73d87cfd4edaf54be9c51 +Bug-Debian: https://bugs.debian.org/883667 +Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2017-17433 + +--- + receiver.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/receiver.c b/receiver.c +index baae3a91..9fdafa15 100644 +--- a/receiver.c ++++ b/receiver.c +@@ -574,6 +574,12 @@ int recv_files(int f_in, int f_out, char *local_name) + file = dir_flist->files[cur_flist->parent_ndx]; + fname = local_name ? local_name : f_name(file, fbuf); + ++ if (daemon_filter_list.head ++ && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0) { ++ rprintf(FERROR, "attempt to hack rsync failed.\n"); ++ exit_cleanup(RERR_PROTOCOL); ++ } ++ + if (DEBUG_GTE(RECV, 1)) + rprintf(FINFO, "recv_files(%s)\n", fname); + +@@ -645,12 +651,6 @@ int recv_files(int f_in, int f_out, char *local_name) + + cleanup_got_literal = 0; + +- if (daemon_filter_list.head +- && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0) { +- rprintf(FERROR, "attempt to hack rsync failed.\n"); +- exit_cleanup(RERR_PROTOCOL); +- } +- + if (read_batch) { + int wanted = redoing + ? we_want_redo(ndx) +-- +2.15.1 + Added: head/net/rsync/files/patch-CVE-2017-17434-1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/rsync/files/patch-CVE-2017-17434-1 Wed Dec 20 14:18:20 2017 (r456798) @@ -0,0 +1,38 @@ +From: Jeriko One +Date: Thu, 16 Nov 2017 17:05:42 -0800 +Subject: [1/2] Sanitize xname in read_ndx_and_attrs. +Origin: https://git.samba.org/?p=rsync.git;a=commit;h=70aeb5fddd1b2f8e143276f8d5a085db16c593b9 +Bug-Debian: https://bugs.debian.org/883665 +Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2017-17434 + +--- + rsync.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/rsync.c b/rsync.c +index b82e5988..a0945ba4 100644 +--- a/rsync.c ++++ b/rsync.c +@@ -49,6 +49,7 @@ extern int flist_eof; + extern int file_old_total; + extern int keep_dirlinks; + extern int make_backups; ++extern int sanitize_paths; + extern struct file_list *cur_flist, *first_flist, *dir_flist; + extern struct chmod_mode_struct *daemon_chmod_modes; + #ifdef ICONV_OPTION +@@ -396,6 +397,11 @@ int read_ndx_and_attrs(int f_in, int f_out, int *iflag_ptr, uchar *type_ptr, + if (iflags & ITEM_XNAME_FOLLOWS) { + if ((len = read_vstring(f_in, buf, MAXPATHLEN)) < 0) + exit_cleanup(RERR_PROTOCOL); ++ ++ if (sanitize_paths) { ++ sanitize_path(buf, buf, "", 0, SP_DEFAULT); ++ len = strlen(buf); ++ } + } else { + *buf = '\0'; + len = -1; +-- +2.15.1 + Added: head/net/rsync/files/patch-CVE-2017-17434-2 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/rsync/files/patch-CVE-2017-17434-2 Wed Dec 20 14:18:20 2017 (r456798) @@ -0,0 +1,27 @@ +From: Jeriko One +Date: Thu, 16 Nov 2017 17:26:03 -0800 +Subject: [2/2] Check daemon filter against fnamecmp in recv_files(). +Origin: https://git.samba.org/?p=rsync.git;a=commit;h=5509597decdbd7b91994210f700329d8a35e70a1 +Bug-Debian: https://bugs.debian.org/883665 +Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2017-17434 + +--- + receiver.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/receiver.c b/receiver.c +index 9fdafa15..9c46242e 100644 +--- a/receiver.c ++++ b/receiver.c +@@ -722,7 +722,7 @@ int recv_files(int f_in, int f_out, char *local_name) + break; + } + if (!fnamecmp || (daemon_filter_list.head +- && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0)) { ++ && check_filter(&daemon_filter_list, FLOG, fnamecmp, 0) < 0)) { + fnamecmp = fname; + fnamecmp_type = FNAMECMP_FNAME; + } +-- +2.15.1 +