DivestOS/Patches/Linux_CVEs/CVE-2017-7308/3.18/2.patch

14 lines
344 B
Diff
Raw Normal View History

2017-10-29 22:14:37 -04:00
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 9c80212..05cfee7 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -3314,6 +3314,8 @@
return -EBUSY;
if (copy_from_user(&val, optval, sizeof(val)))
return -EFAULT;
+ if (val > INT_MAX)
+ return -EINVAL;
po->tp_reserve = val;
return 0;
}