Re: [Patch] x86_64: TASK_SIZE fixes for compatibility mode processes

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

 



"Siddha, Suresh B" <[email protected]> wrote:
>
> +#define TASK_SIZE_OF(child) 	((test_tsk_thread_flag(child, TIF_IA32)) ? IA32_PAGE_OFFSET : TASK_SIZE64)

The task size is an attribute of the task's mm_struct, not of the task.

The place where this tends to come unstuck is when a 32-bit task holds a
reference on a 64-bit tasks's task_struct via a read of a /proc file.  If
the 64-bit task exits then it is the 32-bit task who does the final freeing
of the 64-bit tasks's task_struct and mm_struct.  (and all vice-versa, of
course).  Will your patch handle this race scenario correctly?

I don't have much confidence that we'll get all this stuff right until we
move the task-size info into the mm_struct proper.  Testing the "size" of a
task would then be done via:

	if (task->mm->mm_size == MM_SIZE_32)

or whatever.  Although I suspect the number of places where we need to work
out the "size" of a task would fall markedly.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux