]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/net/udp.h
udp: harden copy_linear_skb()
[karo-tx-linux.git] / include / net / udp.h
index cc8036987dcb885012c6c5eda0fb2bed2e588841..e9b1d1eacb59d0199f4af578e35113017d002a69 100644 (file)
@@ -368,6 +368,8 @@ static inline int copy_linear_skb(struct sk_buff *skb, int len, int off,
 {
        int n, copy = len - off;
 
+       if (copy < 0)
+               return -EINVAL;
        n = copy_to_iter(skb->data + off, copy, to);
        if (n == copy)
                return 0;