user_memcpy()
"Axel Dörfler" <[email protected]>
| Newsgroups | gmane.os.openbeos.kernel.devel |
|---|---|
| Message-ID | <4114296391-BeMail@zon> |
Hi there, François Revol made me recognize a design flaw in our user_memcpy()/ user_strlcpy() API: you have to check the validity of the user address yourself, ie. you have to make sure it's in user space. But we don't have a function for this, just the (kernel private) macro IS_USER_ADDRESS(). And while I like to keep the macro, we should at least export an is_user_address() function. But that would still open a possible source of errors - as you still have to check the address yourself. François suggested to do something similar than Linux that has copy_to_user() and copy_from_user() functions. Since we also have a user_strlcpy() function, I would suggest the following: copy_to_user() copy_from_user() strlcpy_to_user() strlcpy_from_user() user_memset() - or memset_user()? Any preferences? Bye, Axel. ------------------------------------------------------- SF.Net email is sponsored by: Tell us your software development plans! Take this survey and enter to win a one-year sub to SourceForge.net Plus IDC's 2005 look-ahead and a copy of this survey Click here to start! http://www.idcswdc.com/cgi-bin/survey?id5hix