DivestOS/Patches/Linux_CVEs/CVE-2017-7308/3.18/1.patch
2017-10-29 22:14:37 -04:00

14 lines
475 B
Diff

diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 86b3e2f..9c80212 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -3820,6 +3820,8 @@
rb->frames_per_block = req->tp_block_size/req->tp_frame_size;
if (unlikely(rb->frames_per_block <= 0))
goto out;
+ if (unlikely(req->tp_block_size > UINT_MAX / req->tp_block_nr))
+ goto out;
if (unlikely((rb->frames_per_block * req->tp_block_nr) !=
req->tp_frame_nr))
goto out;