I am reading about copy_from_user(…)
and copy_to_user(…)
which copies from user and writes back to user space from kernel. when i see the internal implementation of copy_from_user(…)
, it is having two functions
access_ok(…)
and memcpy(…)
, when i read about access_ok(…)
, it is saying access_ok(…)
is used to check whether the userspace pointer is valid or not.
What check does access_ok(…)
is doing to check the pointer validity?