mm of a new kernel_thread

Oren Laadan (orenl@cs.huji.ac.il)
Thu, 20 Aug 1998 16:16:23 +0300 (IDT)


Hi,

kernel_thread() (in include/asm-i386/unistd.h) is used to create a
new kernel thread, and is designed to be called by kernel processes
like init. It uses CLONE_VM flag so the new kernel process shares the
memory of its parent (usually init).

However, it is possible that a kernel process is created by a user
process: for example, mount() syscall for NFS calls nfs_read_super()
which may call rpdioc_up(), which *may* call kernel_thread(). This
thread will inherit the user process' mm, and they will share it !
This can also happen (maybe even it is now) with drivers that may
call kernel_thread() in respond to some ioctl()s.

A cleaner code would simply give every new kernel thread a new mm
(&init_mm), unless otherwise specified (via flags).

Comments ?

Oren.
__________________________________________________________________________
______ ____ ___ ___ _ __ \
MOSIX Development Group ) ) ) ) ) ( ' ) \ / Oren Laadan \
The Hebrew University / / / / / \ / / orenl@cs.huji.ac.il \
of Jerusalem, Israel ( ( (___( ___) _(_ __/ \_______________________)

http://www.mosix.cs.huji.ac.il E-mail: mosix-devel@cs.huji.ac.il

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html