Re: Calling sys_mlock() from within a driver

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

 



On Fri, Jun 25, 2004 at 09:38:44 -0500, Timur Tabi wrote:
> 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.

No. That's wrong. You need to lock_kiobuf, just like direct read and
write do.

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

Look at the kiobuf stuff.

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@ucw.cz>

Attachment: signature.asc
Description: Digital signature


[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