Allow me to share my thoughts... On Sat, May 3, 2008 at 4:06 AM, Anirban Sinha <ASinha@xxxxxxxxxxxxxxxxx> wrote: > I was poring over the arch/x86/process_32.c:kernel_thread() code. Apparently > (and surprisingly) it sets the kernel threads ds and es register to > __USER_DS. I saw a very old thread on the kernel newbies on this, but I did > not quite find a convincing reason in that thread. Any idea why this is > done? Is it because fork() expects to create user level threads? If that is > so, where and how is this changed to point to KERNEL_DS? maybe because it needs to copy something from user space, but forbid it to step into kernel space. So if it's true, it's likely a security concern rather than general design decision. however, as do we all know, nothing prevents you to change it (by your own) into KERNEL_DS. Overall, i guess it's kinda a way to capture coding flaws....e.g a badly coded function that inject user space data into kernel space. regards, Mulyadi. -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ