summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Wellving <andreas.wellving@enea.com>2018-10-17 14:46:59 +0200
committerAdrian Mangeac <Adrian.Mangeac@enea.com>2018-10-24 12:45:16 +0200
commitc380c25c485c1a2ef86f89a9e2b971c55f3c1b2c (patch)
tree87a0c37325d59277870169a4721372c5ad965897
parent4249123a9fe6922ad8abf912db7d18c2d436dc6d (diff)
downloadenea-kernel-cache-c380c25c485c1a2ef86f89a9e2b971c55f3c1b2c.tar.gz
net/packet: CVE-2017-7308
net/packet: fix overflow in check for priv area size References: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-4.1.y&id=dd07486ceba48b5d2157b212bb9bd5ce9a46b593 Change-Id: I21713abf14677f885f66c627fa0e83dbde286237 Signed-off-by: Andreas Wellving <andreas.wellving@enea.com>
-rw-r--r--patches/cve/4.1.x.scc1
-rw-r--r--patches/cve/CVE-2017-7308-net-packet-fix-overflow-in-check-for-priv-area-size.patch44
2 files changed, 45 insertions, 0 deletions
diff --git a/patches/cve/4.1.x.scc b/patches/cve/4.1.x.scc
index 2f3ae79..17685e1 100644
--- a/patches/cve/4.1.x.scc
+++ b/patches/cve/4.1.x.scc
@@ -11,3 +11,4 @@ patch CVE-2017-7895-nfsd-stricter-decoding-of-write-like-NFSv2-v3-ops.patch
11#fixed in 4.1.41 11#fixed in 4.1.41
12patch CVE-2017-10661-timerfd-Protect-the-might-cancel-mechanism-proper.patch 12patch CVE-2017-10661-timerfd-Protect-the-might-cancel-mechanism-proper.patch
13patch CVE-2017-18221-mlock-fix-mlock-count-can-not-decrease-in-race-condi.patch 13patch CVE-2017-18221-mlock-fix-mlock-count-can-not-decrease-in-race-condi.patch
14patch CVE-2017-7308-net-packet-fix-overflow-in-check-for-priv-area-size.patch
diff --git a/patches/cve/CVE-2017-7308-net-packet-fix-overflow-in-check-for-priv-area-size.patch b/patches/cve/CVE-2017-7308-net-packet-fix-overflow-in-check-for-priv-area-size.patch
new file mode 100644
index 0000000..fbad094
--- /dev/null
+++ b/patches/cve/CVE-2017-7308-net-packet-fix-overflow-in-check-for-priv-area-size.patch
@@ -0,0 +1,44 @@
1From dd07486ceba48b5d2157b212bb9bd5ce9a46b593 Mon Sep 17 00:00:00 2001
2From: Andrey Konovalov <andreyknvl@google.com>
3Date: Wed, 29 Mar 2017 16:11:20 +0200
4Subject: [PATCH] net/packet: fix overflow in check for priv area size
5
6[ Upstream commit 2b6867c2ce76c596676bec7d2d525af525fdc6e2 ]
7
8Subtracting tp_sizeof_priv from tp_block_size and casting to int
9to check whether one is less then the other doesn't always work
10(both of them are unsigned ints).
11
12Compare them as is instead.
13
14Also cast tp_sizeof_priv to u64 before using BLK_PLUS_PRIV, as
15it can overflow inside BLK_PLUS_PRIV otherwise.
16
17CVE: CVE-2017-7308
18Upstream-Status: Backport
19
20Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
21Acked-by: Eric Dumazet <edumazet@google.com>
22Signed-off-by: David S. Miller <davem@davemloft.net>
23Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
24Signed-off-by: Andreas Wellving <andreas.wellving@enea.com>
25---
26 net/packet/af_packet.c | 4 ++--
27 1 file changed, 2 insertions(+), 2 deletions(-)
28
29diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
30index b9d1baa..83c05aa 100644
31--- a/net/packet/af_packet.c
32+++ b/net/packet/af_packet.c
33@@ -3867,8 +3867,8 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u,
34 if (unlikely(req->tp_block_size & (PAGE_SIZE - 1)))
35 goto out;
36 if (po->tp_version >= TPACKET_V3 &&
37- (int)(req->tp_block_size -
38- BLK_PLUS_PRIV(req_u->req3.tp_sizeof_priv)) <= 0)
39+ req->tp_block_size <=
40+ BLK_PLUS_PRIV((u64)req_u->req3.tp_sizeof_priv))
41 goto out;
42 if (unlikely(req->tp_frame_size < po->tp_hdrlen +
43 po->tp_reserve))
44--