Why can user virtual addresses sometimes be dereferenced in the kernel?

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

 



I recently discovered in a driver I'm working on that there are several places where a user-space virtual address is being dereferenced successfully. I was under the impression that that should not work - user pointers should not be usuable in kernel space. The only reason I discovered this is because in one particular kernel (Fedora Core 2), one specific dereference did cause an oops. Why this kernel is special is another question altogether.

So my question is: why did this ever work? My theory is that the process' page tables are still in the MMU when the driver is called, so the virtual address space is technically still valid, even if the kernel won't admit it. Am I right? If so, are the page tables not flushed because it would affect performance? Is there a way I can manual flush the page tables in my driver in order to find all the places in my code where user virtual addresses are used?

--
Timur Tabi
Staff Software Engineer
timur.tabi@xxxxxxxxxxx

--
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