From patchwork Tue Mar 12 23:46:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artem Panfilov X-Patchwork-Id: 1055836 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Z85qCn4C"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44Js8B1CCCz9s71 for ; Wed, 13 Mar 2019 10:47:06 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 35DFE85A80; Tue, 12 Mar 2019 23:47:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RjcnX0czbGi2; Tue, 12 Mar 2019 23:47:02 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5E8BB85A84; Tue, 12 Mar 2019 23:47:02 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 684ED1BF3F0 for ; Tue, 12 Mar 2019 23:47:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 6576E85A84 for ; Tue, 12 Mar 2019 23:47:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bbi6SAa0jzAq for ; Tue, 12 Mar 2019 23:46:59 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 2546285A80 for ; Tue, 12 Mar 2019 23:46:59 +0000 (UTC) Received: by mail-lj1-f179.google.com with SMTP id q128so3853863ljb.11 for ; Tue, 12 Mar 2019 16:46:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wIgM6gYairtWiF0bgoGIndZvDcmVNkjmjCIm7TxCbPg=; b=Z85qCn4CXgfGO3QyatVjQoqIC7k70ldqdBj1S3WotkAwJbUrSdPwRrb7Q31DQ0Q1gR XCw1pruYqmluflGK8C+VsRydPRdKn7q2cO0XsvesWH3UJlc4hC/F9wYDUXI0E0A9KaDZ dAVR6yF5Xk2/M+KEYs6X/+bSEe/U+GotJHJTt1aX6QwrmToHho63SC5hGDcK/86XHeIy 04+/UXdTTv4bsKigNiTsNQ6i3IlCWw2WRGzyrpNDbvavH/WMH9QDq2lYQcR6TMW69jM8 oca5Kx9d/RgKGAid6qfHFHvkMxJuSBGNSGe6362ExBK4dBDIW11z5XDpk8eB3I5ULjHr fK6w== 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 :mime-version:content-transfer-encoding; bh=wIgM6gYairtWiF0bgoGIndZvDcmVNkjmjCIm7TxCbPg=; b=if//6sjswjHaVU+RGUQcSJKtwBYkOC2w6yYBslURf+LDr33hOyRMOz+NSzGmFGvGqa FcMajqd6cFPb6kgHXuJYEpL2MwOl18WDfYbjy0+KdfOjXbw2aFxuhFsTGbRLupynoPUF uKCC5YXfdxQXbdsPTVkvcxSNMysCS2hyrghW/44KR2iE8e2AEG20T/zUdkCvba/B16SO VWfjpO+Af5XelXsqsCT2VGlFVfKvpb519DVvYyhb3AXoSOQ9mLCjGylaAwO8uf1/Qwnf 0Gplez6/6fWDPGAPiAw1qE6Dee1B3sYcYMsuKH7g3XmqyeY4VuoqMrw9TtoSPg0yAqdm tf3Q== X-Gm-Message-State: APjAAAV0u5FLylLp5bZV5sb4/QJOzBWdi1sxvphLZcl5FD5ivmTiP/zY SS+HVOTTB3IX+x5GsB3OzZQbzsB9/m4= X-Google-Smtp-Source: APXvYqx8geehVKwlQkNp74U014lygfry4bE5d4OrfPYWhdF5Glil5mcCGF8Z6W5ryfXmp9voX3jDAA== X-Received: by 2002:a2e:974d:: with SMTP id f13mr3725841ljj.181.1552434417004; Tue, 12 Mar 2019 16:46:57 -0700 (PDT) Received: from localhost.localdomain ([31.134.130.226]) by smtp.googlemail.com with ESMTPSA id h26sm1569926ljf.5.2019.03.12.16.46.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Mar 2019 16:46:56 -0700 (PDT) From: Artem Panfilov To: buildroot@buildroot.org Date: Wed, 13 Mar 2019 02:46:51 +0300 Message-Id: <20190312234651.13693-1-panfilov.artyom@gmail.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2] package/avahi: add upstream security fix X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Artem Panfilov Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Fixes CVE-2017-6519: avahi-daemon in Avahi through 0.6.32 and 0.7 inadvertently responds to IPv6 unicast queries with source addresses that are not on-link, which allows remote attackers to cause a denial of service (traffic amplification) and may cause information leakage by obtaining potentially sensitive information from the responding device via port-5353 UDP packets. Signed-off-by: Artem Panfilov --- Changes v1 -> v2: - add "Signed-off-by" and "Backported from" tags in patch --- ...ast-queries-from-address-not-on-loca.patch | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 package/avahi/0001-Drop-legacy-unicast-queries-from-address-not-on-loca.patch diff --git a/package/avahi/0001-Drop-legacy-unicast-queries-from-address-not-on-loca.patch b/package/avahi/0001-Drop-legacy-unicast-queries-from-address-not-on-loca.patch new file mode 100644 index 0000000000..0e8408c830 --- /dev/null +++ b/package/avahi/0001-Drop-legacy-unicast-queries-from-address-not-on-loca.patch @@ -0,0 +1,48 @@ +From e111def44a7df4624a4aa3f85fe98054bffb6b4f Mon Sep 17 00:00:00 2001 +From: Trent Lloyd +Date: Sat, 22 Dec 2018 09:06:07 +0800 +Subject: [PATCH] Drop legacy unicast queries from address not on local link + +When handling legacy unicast queries, ensure that the source IP is +inside a subnet on the local link, otherwise drop the packet. + +Fixes #145 +Fixes #203 +CVE-2017-6519 +CVE-2018-100084 + +Backported from: e111def44a7df4624a4aa3f85fe98054bffb6b4f +Signed-off-by: Artem Panfilov +--- + avahi-core/server.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/avahi-core/server.c b/avahi-core/server.c +index a2cb19a8..a2580e38 100644 +--- a/avahi-core/server.c ++++ b/avahi-core/server.c +@@ -930,6 +930,7 @@ static void dispatch_packet(AvahiServer *s, AvahiDnsPacket *p, const AvahiAddres + + if (avahi_dns_packet_is_query(p)) { + int legacy_unicast = 0; ++ char t[AVAHI_ADDRESS_STR_MAX]; + + /* For queries EDNS0 might allow ARCOUNT != 0. We ignore the + * AR section completely here, so far. Until the day we add +@@ -947,6 +948,13 @@ static void dispatch_packet(AvahiServer *s, AvahiDnsPacket *p, const AvahiAddres + legacy_unicast = 1; + } + ++ if (!is_mdns_mcast_address(dst_address) && ++ !avahi_interface_address_on_link(i, src_address)) { ++ ++ avahi_log_debug("Received non-local unicast query from host %s on interface '%s.%i'.", avahi_address_snprint(t, sizeof(t), src_address), i->hardware->name, i->protocol); ++ return; ++ } ++ + if (legacy_unicast) + reflect_legacy_unicast_query_packet(s, p, i, src_address, port); + +-- +2.19.1 +