projects
/
GitHub
/
mt8127
/
android_kernel_alcatel_ttab.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7c13a0d
)
net: Fix header size check for GSO case in recvmsg (af_packet)
author
Mariusz Kozlowski
<mk@lab.zgora.pl>
Mon, 8 Nov 2010 11:58:45 +0000
(11:58 +0000)
committer
David S. Miller
<davem@davemloft.net>
Fri, 12 Nov 2010 19:06:46 +0000
(11:06 -0800)
Parameter 'len' is size_t type so it will never get negative.
Signed-off-by: Mariusz Kozlowski <mk@lab.zgora.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/packet/af_packet.c
patch
|
blob
|
blame
|
history
diff --git
a/net/packet/af_packet.c
b/net/packet/af_packet.c
index 0856a13cb53d8001ff33f48cfd7e048721e476d2..8298e676f5a015f58d1b6005cf85938f8c8e142a 100644
(file)
--- a/
net/packet/af_packet.c
+++ b/
net/packet/af_packet.c
@@
-1610,9
+1610,11
@@
static int packet_recvmsg(struct kiocb *iocb, struct socket *sock,
err = -EINVAL;
vnet_hdr_len = sizeof(vnet_hdr);
- if (
(len -= vnet_hdr_len) < 0
)
+ if (
len < vnet_hdr_len
)
goto out_free;
+ len -= vnet_hdr_len;
+
if (skb_is_gso(skb)) {
struct skb_shared_info *sinfo = skb_shinfo(skb);