From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id DD5791395E2 for ; Wed, 7 Dec 2016 23:26:18 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E9BCC21C028; Wed, 7 Dec 2016 23:26:17 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B38CE21C028 for ; Wed, 7 Dec 2016 23:26:17 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 88AA23413A6 for ; Wed, 7 Dec 2016 23:26:16 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id EF1734A1 for ; Wed, 7 Dec 2016 23:26:14 +0000 (UTC) From: "Mike Pagano" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Pagano" Message-ID: <1481153164.04658ca7a302b81aa1b6c44e4bda9850eff15279.mpagano@gentoo> Subject: [gentoo-commits] proj/linux-patches:4.8 commit in: / X-VCS-Repository: proj/linux-patches X-VCS-Files: 0000_README 1520_fix-race-condition-in-packet-set-ring.patch X-VCS-Directories: / X-VCS-Committer: mpagano X-VCS-Committer-Name: Mike Pagano X-VCS-Revision: 04658ca7a302b81aa1b6c44e4bda9850eff15279 X-VCS-Branch: 4.8 Date: Wed, 7 Dec 2016 23:26:14 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 9504636e-2857-4b41-a58f-a79e0bcf84c5 X-Archives-Hash: 36ba1fc258dab2b38f6dff5d2fbb88c5 commit: 04658ca7a302b81aa1b6c44e4bda9850eff15279 Author: Mike Pagano gentoo org> AuthorDate: Wed Dec 7 23:26:04 2016 +0000 Commit: Mike Pagano gentoo org> CommitDate: Wed Dec 7 23:26:04 2016 +0000 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=04658ca7 packet: fix race condition in packet_set_ring. CVE-2016-8655. Bug #601926. 0000_README | 4 ++ 1520_fix-race-condition-in-packet-set-ring.patch | 62 ++++++++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/0000_README b/0000_README index cd56013..af402d3 100644 --- a/0000_README +++ b/0000_README @@ -99,6 +99,10 @@ Patch: 1510_fs-enable-link-security-restrictions-by-default.patch From: http://sources.debian.net/src/linux/3.16.7-ckt4-3/debian/patches/debian/fs-enable-link-security-restrictions-by-default.patch/ Desc: Enable link security restrictions by default. +Patch: 1520_fix-race-condition-in-packet-set-ring.patch +From: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=84ac7260236a49c79eede91617700174c2c19b0c +Desc: packet: fix race condition in packet_set_ring. CVE-2016-8655. Bug #601926. + Patch: 2900_dev-root-proc-mount-fix.patch From: https://bugs.gentoo.org/show_bug.cgi?id=438380 Desc: Ensure that /dev/root doesn't appear in /proc/mounts when bootint without an initramfs. diff --git a/1520_fix-race-condition-in-packet-set-ring.patch b/1520_fix-race-condition-in-packet-set-ring.patch new file mode 100644 index 0000000..d85527f --- /dev/null +++ b/1520_fix-race-condition-in-packet-set-ring.patch @@ -0,0 +1,62 @@ +--- a/net/packet/af_packet.c 2016-12-07 18:10:25.785812861 -0500 ++++ b/net/packet/af_packet.c 2016-12-07 18:18:45.597933525 -0500 +@@ -3648,19 +3648,25 @@ packet_setsockopt(struct socket *sock, i + + if (optlen != sizeof(val)) + return -EINVAL; +- if (po->rx_ring.pg_vec || po->tx_ring.pg_vec) +- return -EBUSY; + if (copy_from_user(&val, optval, sizeof(val))) + return -EFAULT; + switch (val) { + case TPACKET_V1: + case TPACKET_V2: + case TPACKET_V3: +- po->tp_version = val; +- return 0; ++ break; + default: + return -EINVAL; + } ++ lock_sock(sk); ++ if (po->rx_ring.pg_vec || po->tx_ring.pg_vec) { ++ ret = -EBUSY; ++ } else { ++ po->tp_version = val; ++ ret = 0; ++ } ++ release_sock(sk); ++ return ret; + } + case PACKET_RESERVE: + { +@@ -4164,6 +4170,7 @@ static int packet_set_ring(struct sock * + /* Added to avoid minimal code churn */ + struct tpacket_req *req = &req_u->req; + ++ lock_sock(sk); + /* Opening a Tx-ring is NOT supported in TPACKET_V3 */ + if (!closing && tx_ring && (po->tp_version > TPACKET_V2)) { + net_warn_ratelimited("Tx-ring is not supported.\n"); +@@ -4245,8 +4252,6 @@ static int packet_set_ring(struct sock * + goto out; + } + +- lock_sock(sk); +- + /* Detach socket from network */ + spin_lock(&po->bind_lock); + was_running = po->running; +@@ -4294,11 +4299,11 @@ static int packet_set_ring(struct sock * + if (!tx_ring) + prb_shutdown_retire_blk_timer(po, rb_queue); + } +- release_sock(sk); + + if (pg_vec) + free_pg_vec(pg_vec, order, req->tp_block_nr); + out: ++ release_sock(sk); + return err; + } +