projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8f8d28e
)
net/packet: fix overflow in check for tp_reserve
author
Andrey Konovalov
<
[email protected]
>
Wed, 29 Mar 2017 14:11:22 +0000
(16:11 +0200)
committer
David S. Miller
<
[email protected]
>
Thu, 30 Mar 2017 18:04:00 +0000
(11:04 -0700)
When calculating po->tp_hdrlen + po->tp_reserve the result can overflow.
Fix by checking that tp_reserve <= INT_MAX on assign.
Signed-off-by: Andrey Konovalov <
[email protected]
>
Acked-by: Eric Dumazet <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/packet/af_packet.c
patch
|
blob
|
history
diff --git
a/net/packet/af_packet.c
b/net/packet/af_packet.c
index 3ac286ebb2f48f0c1de2b9e7a437f5af5b3bdb9d..8489beff5c25c971067f38833ed4a790a98dd86e 100644
(file)
--- a/
net/packet/af_packet.c
+++ b/
net/packet/af_packet.c
@@
-3665,6
+3665,8
@@
packet_setsockopt(struct socket *sock, int level, int optname, char __user *optv
return -EBUSY;
if (copy_from_user(&val, optval, sizeof(val)))
return -EFAULT;
+ if (val > INT_MAX)
+ return -EINVAL;
po->tp_reserve = val;
return 0;
}