user accesses

Hollis Blanchard hollisb at us.ibm.com
Thu Nov 13 03:37:25 EST 2003


On Wednesday, Nov 12, 2003, at 10:20 US/Central, Nathan Lynch wrote:
>
> I don't think you can directly write to buf here; you should be using
> copy_to_user().  I believe it should look something like this (I've
> omitted error and bounds checking):
>
> static ssize_t ppc_rtas_rmo_buf_read(struct file *file, char __user
> *buf, size_t count, loff_t *ppos)

Notice the "__user" that Nathan slipped in here. :) It enables
automated checking for such problems. See it barely documented at
http://lkml.org/lkml/2003/6/6/146 , and a URL to Linus' "sparse"
checking tool...

--
Hollis Blanchard
IBM Linux Technology Center


** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list