All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] x86: fix free_thread_info() with uninitalized thread_info
@ 2008-12-27  5:16 Akinobu Mita
  2008-12-27  5:17 ` [PATCH 1/4] convert task_struct allocator macros to inline functions Akinobu Mita
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Akinobu Mita @ 2008-12-27  5:16 UTC (permalink / raw)
  To: linux-kernel; +Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin

This patch series fixes a problem described below. The actual fix is only
made by the patch 3/4. The rest of patches help it make simple and there
is no actual behavioral change.

x86 arch specific free_thread_info() accesses thread_info->task to call
free_thread_xstate(). But the thread_info may not be initialized yet.
So invalid pointer derefence may happen in free_thread_xstate().

It happens in the following scenario in dup_task_struct()

1. call alloc_task_struct() to allocate empty task_struct
2. call alloc_thread_info() to allocate empty thread_info
3. call arch_dup_task_struct()

x86 arch specific arch_dup_task_struct() copies task_struct from source
task_struct. it also allocates empty xstate and copy from source if
source task_struct has ->thread.xstate.

If the xstate allocation failed, arch_dup_task_struct() returns error.

4. call free_thread_info() to deallocate thread_info

x86 arch specific free_thread_info() calls free_thread_xstate() with
thread_info->task. But the thread_info is not initialized yet.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-12-27  5:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-27  5:16 [PATCH 0/4] x86: fix free_thread_info() with uninitalized thread_info Akinobu Mita
2008-12-27  5:17 ` [PATCH 1/4] convert task_struct allocator macros to inline functions Akinobu Mita
2008-12-27  5:18 ` [PATCH 2/4] x86: arch specific task_struct allocator Akinobu Mita
2008-12-27  5:19 ` [PATCH 3/4] x86: call free_thread_xstate() in free_task_struct() Akinobu Mita
2008-12-27  5:19 ` [PATCH 4/4] x86: use generic thread_info allocator Akinobu Mita

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.