From patchwork Tue Dec 19 11:56:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Korsgaard X-Patchwork-Id: 850785 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ILUvzgj3"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3z1GbG1t7lz9s9Y for ; Tue, 19 Dec 2017 22:56:40 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 8C7EC86190; Tue, 19 Dec 2017 11:56:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ENo2ri-hj8We; Tue, 19 Dec 2017 11:56:36 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 4A29A85985; Tue, 19 Dec 2017 11:56:36 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 0C76D1C006F for ; Tue, 19 Dec 2017 11:56:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 089A726C7E for ; Tue, 19 Dec 2017 11:56:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gCY3i7ZSXWe6 for ; Tue, 19 Dec 2017 11:56:34 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by silver.osuosl.org (Postfix) with ESMTPS id BA5EB25DBB for ; Tue, 19 Dec 2017 11:56:33 +0000 (UTC) Received: by mail-wm0-f65.google.com with SMTP id 9so3128245wme.4 for ; Tue, 19 Dec 2017 03:56:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=Y2r6hWz6Kr5jZpNwd4oeppm1DjIww2zDzmhc8CIgeYU=; b=ILUvzgj3/KuAy+ityga/abHGmpBe5Lm2WN7D82WvYZEH/1agIoO8mRHAhWon2HQC8h 8zLmymchbv0R0wFrctabj+OUuBAxT3L5JGHWINEKwJWB50l6XLsBcVPtuul/kbFekdEQ WmyqsFutnlBJbxQPDjBPTVW0Txdyv/n7IqbIY1Zyt7TUZRO6ysYX2qqXVvi0of7xbI5A nYloj/3CaENUdFZahE+g0U8f/LaoC8W44xbihRLdxFgfJrY6ftIUyV5V9QrOX2ZkHQkN loBSBoGSc0xKZQYiCru/cS4dBZXd0padJqeCyG1Q4jQy8MhGKd+7F/+PqfM5VCS71vUR HXrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=Y2r6hWz6Kr5jZpNwd4oeppm1DjIww2zDzmhc8CIgeYU=; b=ilT+ODo/Dh+ZdoOGRWMu7gqxpY5OU1Vmvzkykyg++QiPXPPdUG6q91eTWKV5Z+alq2 QO01Vi5CORiFVS4HZ7O3aDmcEgq1kmhyz3CiDvsfCyIEFcCD01VGiU0nVrwESV22Vkwa pltvjbRxMoeAclk1edS5+RNh4kXGG45tUsyy2IPu+O+A6yCrekpWVNUSJVOxx+R5BeJb rGP0Fei7nHBX+CUByr5cTPS/eOFityfo+RCdGVDRJU+NIdqRulvGrH5fAKVWYQGlzfx0 lj8kC2YbhfpQnG6I0sUlRc/obe2fM/vO+ly7Y69TAiHXmXuSjY6ktg76iI7ELyemz25f YvNw== X-Gm-Message-State: AKGB3mJPh/3che1CftWpHy15wPl/7zs0BrH59o7lT1X+V7Ij6M+BKE+O pZuK55xyFyINjQk0ZnJUsoLKT99k X-Google-Smtp-Source: ACJfBout7CdP8DDAyDyaSEBb6OdDlPOacCF2ojFMxOPhLsD6eQsZZ/RWeJocoCeTyTCmiKPY3yC+CA== X-Received: by 10.80.140.237 with SMTP id r42mr185395edr.299.1513684591847; Tue, 19 Dec 2017 03:56:31 -0800 (PST) Received: from dell.be.48ers.dk (ptr-bvxwyj9hmyz9swdo3rb.18120a2.ip6.access.telenet.be. [2a02:1811:8c2c:ff00:ba8a:60ff:feb3:d607]) by smtp.gmail.com with ESMTPSA id c25sm13129507edb.52.2017.12.19.03.56.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Dec 2017 03:56:31 -0800 (PST) Received: from peko by dell.be.48ers.dk with local (Exim 4.89) (envelope-from ) id 1eRGVa-0004NS-6J; Tue, 19 Dec 2017 12:56:30 +0100 From: Peter Korsgaard To: buildroot@buildroot.org, baruch@tkos.co.il Date: Tue, 19 Dec 2017 12:56:28 +0100 Message-Id: <20171219115628.16785-1-peter@korsgaard.com> X-Mailer: git-send-email 2.11.0 Subject: [Buildroot] [PATCH] rsync: add upstream security fix for CVE-2017-16548 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The receive_xattr function in xattrs.c in rsync 3.1.2 and 3.1.3-development does not check for a trailing '\0' character in an xattr name, which allows remote attackers to cause a denial of service (heap-based buffer over-read and application crash) or possibly have unspecified other impact by sending crafted data to the daemon. For more details, see: https://bugzilla.samba.org/show_bug.cgi?id=13112 Signed-off-by: Peter Korsgaard --- ...ailing-0-when-receiving-xattr-name-values.patch | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 package/rsync/0004-Enforce-trailing-0-when-receiving-xattr-name-values.patch diff --git a/package/rsync/0004-Enforce-trailing-0-when-receiving-xattr-name-values.patch b/package/rsync/0004-Enforce-trailing-0-when-receiving-xattr-name-values.patch new file mode 100644 index 0000000000..be9040010c --- /dev/null +++ b/package/rsync/0004-Enforce-trailing-0-when-receiving-xattr-name-values.patch @@ -0,0 +1,33 @@ +From 47a63d90e71d3e19e0e96052bb8c6b9cb140ecc1 Mon Sep 17 00:00:00 2001 +From: Wayne Davison +Date: Sun, 5 Nov 2017 11:33:15 -0800 +Subject: [PATCH] Enforce trailing \0 when receiving xattr name values. Fixes + bug 13112. + +Fixes CVE-2017-16548 + +Signed-off-by: Peter Korsgaard +--- +Patch status: upstream commit 47a63d90e7 + + 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.11.0 +