linux/include
Ingo Molnar e00320875d x86: fix stackprotector canary updates during context switches
fix a bug noticed and fixed by pageexec@freemail.hu.

if built with -fstack-protector-all then we'll have canary checks built
into the __switch_to() function. That does not work well with the
canary-switching code there: while we already use the %rsp of the
new task, we still call __switch_to() whith the previous task's canary
value in the PDA, hence the __switch_to() ssp prologue instructions
will store the previous canary. Then we update the PDA and upon return
from __switch_to() the canary check triggers and we panic.

so update the canary after we have called __switch_to(), where we are
at the same stackframe level as the last stackframe of the next
(and now freshly current) task.

Note: this means that we call __switch_to() [and its sub-functions]
still with the old canary, but that is not a problem, both the previous
and the next task has a high-quality canary. The only (mostly academic)
disadvantage is that the canary of one task may leak onto the stack of
another task, increasing the risk of information leaks, were an attacker
able to read the stack of specific tasks (but not that of others).

To solve this we'll have to reorganize the way we switch tasks, and move
the PDA setting into the switch_to() assembly code. That will happen in
another patch.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2008-05-26 16:15:31 +02:00
..
acpi
asm-alpha asm-{alpha,h8300,um,v850,xtensa}/param.h: unbreak HZ for userspace 2008-05-14 19:11:14 -07:00
asm-arm [ARM] fix OMAP include loops 2008-05-23 15:38:07 +01:00
asm-avr32 avr32: types: use <asm-generic/int-*.h> for the avr32 architecture 2008-05-02 16:18:20 -07:00
asm-blackfin Blackfin serial driver: add extra IRQ flag for 8250 serial driver 2008-05-17 18:21:57 +08:00
asm-cris cris: types: use <asm-generic/int-*.h> for the cris architecture 2008-05-02 16:18:20 -07:00
asm-frv read_barrier_depends arch fixlets 2008-05-14 10:05:18 -07:00
asm-generic gpio: build fixes 2008-05-24 09:56:13 -07:00
asm-h8300 asm-{alpha,h8300,um,v850,xtensa}/param.h: unbreak HZ for userspace 2008-05-14 19:11:14 -07:00
asm-ia64 KVM: ia64: Set KVM_IOAPIC_NUM_PINS to 48 2008-05-18 14:34:16 +03:00
asm-m32r m32r: types: use <asm-generic/int-*.h> for the m32r architecture 2008-05-02 16:18:21 -07:00
asm-m68k m68k: Prefix ISA type with ISA_TYPE_ 2008-05-18 13:28:50 -07:00
asm-m68knommu m68knommu: rework definition of HZ 2008-05-01 08:08:36 -07:00
asm-mips fix parenthesis in include/asm-mips/mach-au1x00/au1000.h 2008-05-24 09:56:08 -07:00
asm-mn10300 MN10300: Make cpu_relax() invoke barrier() 2008-05-08 10:49:39 -07:00
asm-parisc parisc: use conditional macro for 64-bit wide ops 2008-05-15 11:03:43 -04:00
asm-powerpc [POWERPC] mpic: Fix use of uninitialized variable 2008-05-23 16:15:37 +10:00
asm-ppc [POWERPC] ppc: More compile fixes 2008-05-12 22:57:51 +10:00
asm-s390 [S390] s390dbf: Use const char * for dbf name. 2008-05-15 16:52:39 +02:00
asm-sh sh: use the common ascii hex helpers 2008-05-16 15:09:08 +09:00
asm-sparc sparc: remove CVS keywords 2008-05-20 00:33:44 -07:00
asm-sparc64 sparc64: Add global register dumping facility. 2008-05-20 00:33:45 -07:00
asm-um asm-{alpha,h8300,um,v850,xtensa}/param.h: unbreak HZ for userspace 2008-05-14 19:11:14 -07:00
asm-v850 asm-{alpha,h8300,um,v850,xtensa}/param.h: unbreak HZ for userspace 2008-05-14 19:11:14 -07:00
asm-x86 x86: fix stackprotector canary updates during context switches 2008-05-26 16:15:31 +02:00
asm-xtensa asm-{alpha,h8300,um,v850,xtensa}/param.h: unbreak HZ for userspace 2008-05-14 19:11:14 -07:00
crypto [CRYPTO] api: Fix scatterwalk_sg_chain 2008-05-01 18:22:28 +08:00
keys
linux x86: fix stackprotector canary updates during context switches 2008-05-26 16:15:31 +02:00
math-emu
media Fix a deadlock in the bttv driver 2008-05-20 10:12:26 -07:00
mtd
net Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/linville/wireless-2.6 2008-05-19 16:29:40 -07:00
pcmcia
rdma IB: expand ib_umem_get() prototype 2008-04-29 08:06:12 -07:00
rxrpc
scsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2008-05-02 13:52:35 -07:00
sound [ALSA] ASoC: build fix for snd_soc_info_bool_ext 2008-05-13 14:47:44 +02:00
video fbdev: platforming hecubafb and n411 2008-04-28 08:58:41 -07:00
xen
Kbuild