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

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

 



On Fri, Jan 21, 2005 at 09:03:48 -0600, Timur Tabi wrote:
> girish shilamkar wrote:
> 
> >    user space virtual address are always valid even in kernel e.g
> >    sys_read( char * _user buff, pos, count); requires to access user
> >    buffer to perform read.

Sure. But it can't be accessed directly.

> In the case of system calls, I thought the kernel translated those user 
> virtual addresses into kernel virtual addresses for the driver.

Why the hell would it do it? If you need to access useland, you have
copy_from_user and copy_to_user. IIRC there are also variants for
copying NUL-terminated strings, but I don't recall their names.

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@xxxxxx>

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