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.

  1. After doing this, I have permission to enter and pass Uaddr in my kernel module function? Or maybe I have to use these struct pages in any way?
  2. Why use me to read / down?
  3. I have everything after SetPageDirty () and page_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

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -