Re: Calling sys_mlock() from within a driver

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

 



Jan Hudec wrote:

Are you sure? The sys_mlock manipulates userspace memory. But a driver
does not have any userspace memory to manipulate. It only has kernel
memory and that is not swappable.

We use sys_mlock() to lock user-space memory. We need to create a list of physical addresses for every page in the app's buffer. This buffer needs to be locked down and then its contents DMA'd to our hardware.


Because that function is a syscall. You should call it as a syscall. But
since it only affects userspace memory, the userspace should call it.
Really.

Userspace can't call it because only root can call sys_mlock() and we can't require that the calling process be root.


Could you please tell us what you want to do? It seems quite likely that
there is a better solution than trying to call sys_mlock.

I agree, but I haven't been able to find it yet.


-- Timur Tabi Staff Software Engineer timur.tabi@ammasso.com

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