Talib Alim wrote:
I have to verify buffer passed by user program is valid or not. I am
using access_ok, on i386 plateform. If I pass NULL, access_ok does not
catch it.
How can I check for WRITE validity of buffer passed by the user.
copy_to_user is not a good choice for me, since I processing data is a
loop, which is under spinlock. So to use copy_to_user I have to modify
logic.
How about,
for (...) {
get/set data using copy_{to,from}_user
acquire spinlock
process
release spinlock
}
HTH,
Om
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/