lkml.org 
[lkml]   [2002]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: AUDIT of 2.5.15 copy_to/from_user
On Sun, 19 May 2002, Alan Cox wrote:

> Looking at 2.4.1x which has the same signal code
>
> > arch/i386/kernel/signal.c:37: return __copy_to_user(to, from, sizeof(siginfo_t));
>
> not a bug
> > arch/sparc/kernel/signal.c:101: return __copy_to_user(to, from, sizeof(siginfo_t));
>
> Not a bug
>
> > arch/alpha/kernel/signal.c:44: return __copy_to_user(to, from, sizeof(siginfo_t));
>
> Not a bug
>

Hi,

Halfway this thread I got I bit confused...

copy_to/from_user() --> will return the number of bytes that were _not_
copied. If one does not care about partially successes just use:

if (copy_to/from_user())
return -EFAULT;

__copy_to/from_user() --> the same as above, but can they actually return
anything other than 0? My assembler is no good and I'm not able to see if
the macros __constant_copy_user(), __copy_user(), __constant_copy_user_zeroing(),
modify the size argument.

Rui Sousa

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:22    [W:0.130 / U:0.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site