linux/arch
Fernando Vazquez dc2bc768a0 [PATCH] stack overflow safe kdump: safe_smp_processor_id()
This is a the first of a series of patch-sets aiming at making kdump more
robust against stack overflows.

This patch set does the following:

* Add safe_smp_processor_id function to i386 architecture (this function was
  inspired by the x86_64 function of the same name).

* Substitute "smp_processor_id" with the stack overflow-safe
  "safe_smp_processor_id" in the reboot path to the second kernel.

This patch:

On the event of a stack overflow critical data that usually resides at the
bottom of the stack is likely to be stomped and, consequently, its use should
be avoided.

In particular, in the i386 and IA64 architectures the macro smp_processor_id
ultimately makes use of the "cpu" member of struct thread_info which resides
at the bottom of the stack.  x86_64, on the other hand, is not affected by
this problem because it benefits from the use of the PDA infrastructure.

To circumvent this problem I suggest implementing "safe_smp_processor_id()"
(it already exists in x86_64) for i386 and IA64 and use it as a replacement
for smp_processor_id in the reboot path to the dump capture kernel.  This is a
possible implementation for i386.

Signed-off-by: Fernando Vazquez <fernando@intellilink.co.jp>
Looks-reasonable-to: Andi Kleen <ak@muc.de>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Vivek Goyal <vgoyal@in.ibm.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-10-01 00:39:30 -07:00
..
alpha [PATCH] kill wall_jiffies 2006-10-01 00:39:27 -07:00
arm [PATCH] kill wall_jiffies 2006-10-01 00:39:27 -07:00
arm26 [PATCH] kill wall_jiffies 2006-10-01 00:39:27 -07:00
avr32 [PATCH] simplify update_times (avoid jiffies/jiffies_64 aliasing problem) 2006-09-29 09:18:15 -07:00
cris [PATCH] kill wall_jiffies 2006-10-01 00:39:27 -07:00
frv [PATCH] simplify update_times (avoid jiffies/jiffies_64 aliasing problem) 2006-09-29 09:18:15 -07:00
h8300 [PATCH] simplify update_times (avoid jiffies/jiffies_64 aliasing problem) 2006-09-29 09:18:15 -07:00
i386 [PATCH] stack overflow safe kdump: safe_smp_processor_id() 2006-10-01 00:39:30 -07:00
ia64 [PATCH] kill wall_jiffies 2006-10-01 00:39:27 -07:00
m32r [PATCH] kill wall_jiffies 2006-10-01 00:39:27 -07:00
m68k [PATCH] kill wall_jiffies 2006-10-01 00:39:27 -07:00
m68knommu [PATCH] kill wall_jiffies 2006-10-01 00:39:27 -07:00
mips [PATCH] kill wall_jiffies 2006-10-01 00:39:27 -07:00
parisc [PATCH] kill wall_jiffies 2006-10-01 00:39:27 -07:00
powerpc [PATCH] kill wall_jiffies 2006-10-01 00:39:27 -07:00
ppc [PATCH] kill wall_jiffies 2006-10-01 00:39:27 -07:00
s390 [PATCH] Vectorize aio_read/aio_write fileop methods 2006-10-01 00:39:28 -07:00
sh [PATCH] kill wall_jiffies 2006-10-01 00:39:27 -07:00
sh64 [PATCH] kill wall_jiffies 2006-10-01 00:39:27 -07:00
sparc [PATCH] kill wall_jiffies 2006-10-01 00:39:27 -07:00
sparc64 [PATCH] kill wall_jiffies 2006-10-01 00:39:27 -07:00
um [PATCH] Remove ->rq_status from struct request 2006-09-30 20:29:23 +02:00
v850 [PATCH] proper flags type of spin_lock_irqsave() 2006-10-01 00:39:21 -07:00
x86_64 [PATCH] kill wall_jiffies 2006-10-01 00:39:27 -07:00
xtensa [PATCH] kill wall_jiffies 2006-10-01 00:39:27 -07:00