diff options
-rw-r--r-- | patches/cve/4.1.x.scc | 1 | ||||
-rw-r--r-- | patches/cve/CVE-2017-7308-net-packet-fix-overflow-in-check-for-priv-area-size.patch | 44 |
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 |
12 | patch CVE-2017-10661-timerfd-Protect-the-might-cancel-mechanism-proper.patch | 12 | patch CVE-2017-10661-timerfd-Protect-the-might-cancel-mechanism-proper.patch |
13 | patch CVE-2017-18221-mlock-fix-mlock-count-can-not-decrease-in-race-condi.patch | 13 | patch CVE-2017-18221-mlock-fix-mlock-count-can-not-decrease-in-race-condi.patch |
14 | patch 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 @@ | |||
1 | From dd07486ceba48b5d2157b212bb9bd5ce9a46b593 Mon Sep 17 00:00:00 2001 | ||
2 | From: Andrey Konovalov <andreyknvl@google.com> | ||
3 | Date: Wed, 29 Mar 2017 16:11:20 +0200 | ||
4 | Subject: [PATCH] net/packet: fix overflow in check for priv area size | ||
5 | |||
6 | [ Upstream commit 2b6867c2ce76c596676bec7d2d525af525fdc6e2 ] | ||
7 | |||
8 | Subtracting tp_sizeof_priv from tp_block_size and casting to int | ||
9 | to check whether one is less then the other doesn't always work | ||
10 | (both of them are unsigned ints). | ||
11 | |||
12 | Compare them as is instead. | ||
13 | |||
14 | Also cast tp_sizeof_priv to u64 before using BLK_PLUS_PRIV, as | ||
15 | it can overflow inside BLK_PLUS_PRIV otherwise. | ||
16 | |||
17 | CVE: CVE-2017-7308 | ||
18 | Upstream-Status: Backport | ||
19 | |||
20 | Signed-off-by: Andrey Konovalov <andreyknvl@google.com> | ||
21 | Acked-by: Eric Dumazet <edumazet@google.com> | ||
22 | Signed-off-by: David S. Miller <davem@davemloft.net> | ||
23 | Signed-off-by: Sasha Levin <alexander.levin@verizon.com> | ||
24 | Signed-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 | |||
29 | diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c | ||
30 | index 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 | -- | ||