Re: 2.6.9-rc3-mm3

From: Jesper Juhl
Date: Thu Oct 07 2004 - 05:12:53 EST


> Changes since 2.6.9-rc3-mm2:
>
[...]
> +ds_ioctl-usercopy-check.patch
>
> usercopy checks
>
[...]

After recieving some feedback from Christoph Hellwig I believe this is
probably a better version of the patch (no reason not to use the
access_ok checking version of copy_to_user) :

Signed-off-by: Jesper Juhl <juhl-lkml@xxxxxx>

diff -up linux-2.6.9-rc3-bk5-orig/drivers/pcmcia/ds.c linux-2.6.9-rc3-bk5/drivers/pcmcia/ds.c
--- linux-2.6.9-rc3-bk5-orig/drivers/pcmcia/ds.c 2004-10-05 22:07:27.000000000 +0200
+++ linux-2.6.9-rc3-bk5/drivers/pcmcia/ds.c 2004-10-06 22:20:27.000000000 +0200
@@ -1046,7 +1046,11 @@ static int ds_ioctl(struct inode * inode
}
}

- if (cmd & IOC_OUT) __copy_to_user(uarg, (char *)&buf, size);
+ if (cmd & IOC_OUT) {
+ if (copy_to_user(uarg, (char *)&buf, size))
+ err = -EFAULT;
+ }
+

return err;
} /* ds_ioctl */


-
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/