Re: video_usercopy() enforces change of VideoText IOCTLs since2.6.8

From: Andrew Morton
Date: Fri Oct 08 2004 - 15:58:10 EST


Gerd Knorr <kraxel@xxxxxxxxxxx> wrote:
>
> Yes, that change is wrong. It breaks all ioctls which use arg to pass
> a integer value directly (i.e. not a pointer to a integer).
>
> The patch below reverses it. Please apply,
>
> Gerd
>
> Index: linux-2.6.8/drivers/media/video/videodev.c
> ===================================================================
> --- linux-2.6.8.orig/drivers/media/video/videodev.c 2004-10-08 11:55:08.000000000 +0200
> +++ linux-2.6.8/drivers/media/video/videodev.c 2004-10-08 12:46:12.571630864 +0200
> @@ -183,7 +183,7 @@ video_usercopy(struct inode *inode, stru
> /* Copy arguments into temp kernel buffer */
> switch (_IOC_DIR(cmd)) {
> case _IOC_NONE:
> - parg = NULL;
> + parg = (void*)arg;
> break;

(the typecast is unneeded)

Seems that with this change we are now sometimes passing a user pointer
into (*func)(). And we're sometimes passing a kernel pointer, yes?

Are all the implementations of (*func)() handling that correctly?

It all looks fishy.
-
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/