Find the answer to your Linux question:
Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By gettyUp
Hi, I just started linux system programming and little bit of driver programming. I came across some functions like put_user and get_user, and i read that when we are writting ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2011
    Posts
    21

    put_user and get_user


    Hi,
    I just started linux system programming and little bit of driver programming.

    I came across some functions like put_user and get_user, and i read that when we are writting device drivers we should not use direct assignmnet of pointers especially when trying to acsess uspace from kspace and vice versa.

    But i could not get proper reasons even after some googling to why it is not allowed to use direct assignment.

    I would appreciate any help in this.

    Thanks,
    Oxpac.

  2. #2
    Just Joined!
    Join Date
    Oct 2006
    Posts
    32
    A pointer into userspace should never be simply dereferenced: data should be copied using these routines. See the link for more information as to why an API is preferred to use for memory access.

    User space memory access from the Linux kernel
    oxpac likes this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •