Re: [PATCH] Kill a sparse warning in binfmt_elf.c

From: Arun Sharma
Date: Thu Oct 07 2004 - 20:46:24 EST


On 10/7/2004 12:16 PM, Valdis.Kletnieks@xxxxxx wrote:

Hmm.. there it's a 'const char *name', but we feed it to a 'const void *'
and then you cast it to a __user.

I'm not very concerned about const char * being cast to const void *. That's not the focus of the patch[1]. The focus of the patch is really __user.

Either that *name should be __user
as well, or you tagged something as a __user that might not be.


Certain interfaces such as get_user() will fail if you pass a kernel pointer and unconditionally cast it to __user (without doing a set_fs(KERNEL_DS)). But file_operations->write() is not one of them and hence the patch.

-Arun

[1] If you insist on this, you should change all the calls to memcpy() as well.
-
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/