netdev
[Top] [All Lists]

[PATCH 1/5] tun check error on memcpy_fromiovec

To: Chris Wright <chrisw@xxxxxxxx>
Subject: [PATCH 1/5] tun check error on memcpy_fromiovec
From: maximilian attems <janitor@xxxxxxxxxxxxxx>
Date: Fri, 19 Dec 2003 11:34:58 +0100
Cc: netdev@xxxxxxxxxxx
In-reply-to: <20031208202302.C30587@xxxxxxxxxxxxxxxxxx>
Mail-followup-to: Chris Wright <chrisw@xxxxxxxx>, netdev@xxxxxxxxxxx
References: <20031208202302.C30587@xxxxxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.4i
hey chris,

after applying your 4 patches on top of linux-2.6.0 
+ experimental net, 
found 2 last unchecked memcpy_fromiovec in tun.c
patch bellow fixes the second call, 
the first is beyond me, please complete this patch :)
compile tested

thx max



--- linux-2.6.0-net/drivers/net/tun.c   2003-12-19 11:27:38.000000000 +0100
+++ linux/drivers/net/tun.c     2003-12-19 11:19:33.000000000 +0100
@@ -193,7 +193,10 @@
        }
 
        skb_reserve(skb, 2);
-       memcpy_fromiovec(skb_put(skb, len), iv, len);
+       if (memcpy_fromiovec(skb_put(skb, len), iv, len)) {
+               kfree_skb(skb);
+               return -EFAULT;
+       }
 
        skb->dev = tun->dev;
        switch (tun->flags & TUN_TYPE_MASK) {

Attachment: pgpjQYx8gPdRr.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>