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

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

 



Timur Tabi wrote:
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?

I found the sparse tool

http://www.codemonkey.org.uk/projects/bitkeeper/sparse/

to be very helpful to find instances where I was dereferencing __user
pointers.

Of course, you can still get around the sparse tool, but for the most part, it did a very good job of finding a few instances of this in my code.

- Andrew Ruder

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