You can get the differents memory regions of the process by the following fields :Hey folks,
How do I (in a syscall) check that an address passed to me is in the user's address space?
Athul
-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/
current->mmap, current->mmap_avl and current->mmap_cache. These fields are struct vm_area_struct type.
struct vm_area_struct{ unsigned long vm_start ; unsigned long vm_end ; .... };
So you cab check every region of the current process and see if the adress passed exists in memory space of the process.
But are you sure you need to do this test ?
try to use the functions get_users and verify the data after. Should be better.
-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/