diff options
author | Alexander Drozdov <al.drozdov@gmail.com> | 2015-02-17 13:33:46 +0300 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-03-14 22:37:11 +0300 |
commit | 913c52e4ef72da0a91ee55acdbce34072ac4011e (patch) | |
tree | 45c9511074257f3a13edefc663fe0b656d66f865 /net/ipv4 | |
parent | aaf410beca530f2c17de11ad7202a864876688c1 (diff) | |
download | linux-913c52e4ef72da0a91ee55acdbce34072ac4011e.tar.xz |
ipv4: ip_check_defrag should correctly check return value of skb_copy_bits
[ Upstream commit fba04a9e0c869498889b6445fd06cbe7da9bb834 ]
skb_copy_bits() returns zero on success and negative value on error,
so it is needed to invert the condition in ip_check_defrag().
Fixes: 1bf3751ec90c ("ipv4: ip_check_defrag must not modify skb before unsharing")
Signed-off-by: Alexander Drozdov <al.drozdov@gmail.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/ip_fragment.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c index 2811cc18701a..a1856215f77a 100644 --- a/net/ipv4/ip_fragment.c +++ b/net/ipv4/ip_fragment.c @@ -665,7 +665,7 @@ struct sk_buff *ip_check_defrag(struct sk_buff *skb, u32 user) if (skb->protocol != htons(ETH_P_IP)) return skb; - if (!skb_copy_bits(skb, 0, &iph, sizeof(iph))) + if (skb_copy_bits(skb, 0, &iph, sizeof(iph)) < 0) return skb; if (iph.ihl < 5 || iph.version != 4) |