Re: copy_to/from_use query?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Aboo Valappil wrote:

You must be tired of answering questions :)

It's relaxing. More to the point, when I started working with Linux there were no useful fora such as this to help me so I learn by as always by pottering along and making various mistakes on the way.


[ discussion about copy_[from|to]_user context ]

*). Check page is available.

Point number 2 here ( check page is available ) ... What if page is not
available and there is no page table/page directory set up for this ?

Then the process just issued a dud request (in which case the memory will not exist within the current process' vmas) or the page is part of a valid mapping but not in memory so it needs to be brought in.


Does it cause a page fault ?

If there's no valid page table entry then the fault handler will run and it knows if we're in the kernel already when it gets called.


Why is copy_to_user() required ?

Mostly to check that any access is allowed and valid for a given process. The standard fault handler will run if necessary.


Jon.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux