Re: Followup: copy_to_user

Michael Elizabeth Chastain (mec@shout.net)
Fri, 23 Jan 1998 16:42:00 -0600


Hi Andi and everybody,

andi> It doesn't do this and is correct then. Now I don't understand your
andi> original point at all, sorry.

Ok, let me try from scratch here:

#1 I claimed that __generic_copy_to_user has a bug and always returns
the number of bytes requested, not the number of bytes uncopied.
I blew it here. I didn't realize that __copy_user is a macro that
modifies its arguments. Perhaps there still is a bug because of
subtle assembly problems but I was essentially wrong. I am going
to abandon this claim.

#2 The interface to copy_to_user is not documented.

#3 This lack of documentation has led to several people using it as if
the interface were -EFAULT / 0.

I don't have any problem with the interface to copy_to_user. I did
have a problem with one code path failing to implement it (#1), but it
appears I was wrong there. I still stand by (#2). I think the right
thing to do for (#3) is to fix the callers, not change the interface.

I'm sorry for causing confusion and taking up people's attention
with a red herring. But #2 is still a flaw and #3 still leads to bugs.

Regards,

Michael Chastain
<mailto:mec@shout.net>
"love without fear"