Re: move_addr_to_kernel() and memory considerations!!!

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

 



On Monday 14 May 2007 15:11, pradeep singh wrote:
> Hi,
> here is the code snippet to copy a socket address to kernel address space
> from user address space.
>
> int move_addr_to_kernel(void __user *uaddr, int ulen, void *kaddr)
> {
>     if(ulen<0||ulen>MAX_SOCK_ADDR)
>        return -EINVAL;
>     if(ulen==0)
>       return 0;
>     if(copy_from_user(kaddr,uaddr,ulen))
>         return -EFAULT;
>         return audit_sockaddr(ulen, kaddr);
> }
>
> Ok, here is the query -
> What if the user address is actually mapped on to physical memory > 1 GB.
> I cannot figure out then how the socket address space will be copied
> without involving any temporary kernel mappings?And i also do not see any
> code involving creation of  the temporary mappings in this case?
>

You already have the buffer mapped: somewhere in userspace. And this runs from 
process context, thus you can access it's address space.

tavi

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at 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