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 the line "unsubscribe linux-net" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html