Re: why set_fs (was "socket programming in kernel space")

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

 



Dear Fawaad

Thank you very much for sending me the document from Mr Rubini. Here is 
the sentences that convince me that I am correct:

"Before calling the function, however, a preparing step must be 
performed. Like any other function that transfers data to/from user 
space using a user-provided pointer, the system call checks whether the 
provided buffer is a valid address or not. During normal operation, an 
address that lies in the user address range (0-3GB for standard kernel 
configuration) is considered valid, and an address that lies in kernel 
address space (3GB-4GB) is not. 


If the system call is invoked from kernel space, though, we must prevent 
the usual check to fail, because the virtual address of our destination 
buffer will be in kernel space, above the 3GB mark. "

I hope it also helps other to shed some light for this kind of issue.

regards

Mulyadi


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