[PATCH] missing copy_to_user check in tun driver.

From: davej
Date: Mon Aug 11 2003 - 11:28:46 EST


diff -urpN --exclude-from=/home/davej/.exclude bk-linus/drivers/net/tun.c linux-2.5/drivers/net/tun.c
--- bk-linus/drivers/net/tun.c 2003-06-17 00:23:21.000000000 +0100
+++ linux-2.5/drivers/net/tun.c 2003-06-25 12:26:54.000000000 +0100
@@ -459,7 +459,8 @@ static int tun_chr_ioctl(struct inode *i
if (err)
return err;

- copy_to_user((void *)arg, &ifr, sizeof(ifr));
+ if (copy_to_user((void *)arg, &ifr, sizeof(ifr)))
+ return -EFAULT;
return 0;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/