User space access from Kernel space - get_user_pages -
I have to pass an indicator with a user location memory in the function in a kernel module, I copy_from_user Do not want to use. I have read that I should use the get_user_pages function.
For example a page.
struct page ** page; Pages = kmolek (1 * size (* page), GFP_KERNL); Down_read (& amp; current-> mm- & gt; mmap_sem); Get_user_pages (current, present-> mm, UADR, 1, 1, 0, pages, faucets); Up_read (& amp; current-> mm- & gt; mmap_sem); uaddr is an address in the user space.
- After doing this, I have permission to enter and pass
Uaddrin my kernel module function? Or maybe I have to use thesestruct pagesin any way? - Why use me to read / down?
- I have everything after
SetPageDirty ()andpage_cache_release ()functions
It is not for get_user_pages to use
uaddr ).
If you do not want to call copy_from_user in the calling function, simply pass a zero __user * in your module function and Do this to copy_from_user .
Comments
Post a Comment