userspace vs. kernelspace address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

If I'm given a particular address, how do I test
whether that address is from userspace or from kernel
space?

I need to make these decisions from either inside a
kernel module or a userspace program. The idea is I
use memcpy() in the user-user version,
copy_from/to_user in the kernel-kernel version, and
prohibit the others.

Is it safe to test the address against PAGE_OFFSET in
the module? I agree it could be non-portable in
userspace if people have changed their PAGE_OFFSET in
the kernels they are running.

I'm using 2.4.18 vanilla from ftp.kernel.org

Thanks and regards,
Rock

PS: Please CC me, I'm not on the list.


		
__________________________________ 
Do you Yahoo!? 
Read only the mail you want - Yahoo! Mail SpamGuard. 
http://promotions.yahoo.com/new_mail 

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux