linux/include/asm-i386
Roland McGrath 6ea65ff79c [PATCH] i386: clear segment register padding in core dumps
The segment register slots in struct pt_regs are padded to 32 bits.
Some of these are stored with instructions like "pushl %es", which
leaves the high 16 bits as they were.  So the high bits of these
fields in struct pt_regs contain kernel stack garbage.  These bits are
ignored by everything and never leak to user space, except in core
dumps.  The user struct pt_regs is always at the base of the thread's
kernel stack and so it seems unlikely the information that leaks from
here is ever worthwhile so as to be a security concern, but I'm not
sure about that.  It has been this way for ages; userland consumers of
core dumps all mask off these high bits themselves.  So it is not urgent.

This change masks off the padding bits of the segment register slots
in core dumps.  ptrace already masks off these high bits, so this
makes the values in core dumps consistent with what ptrace would
report just before the process died.

As I read the processor manuals, the cs and ss values will always be
padded with zero bits rather than stack garbage.  But unlike "pushl %es",
this is not simple to test with a userland program.  So I added the two
instructions rather than wonder if they are really never necessary.

I think that x86_64 does not have this problem (for either 32-bit or
64-bit processes).  It only uses "mov" instructions from segment
registers, which zero-extend.

Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-03-23 15:32:58 -07:00
..
mach-bigsmp
mach-default [PATCH] clockevents: i386 drivers 2007-02-16 08:13:59 -08:00
mach-es7000 ACPICA: Remove duplicate table definitions (non-conflicting), cont 2007-02-02 21:14:29 -05:00
mach-generic
mach-numaq
mach-summit
mach-visws
mach-voyager [PATCH] clockevents: i386 drivers 2007-02-16 08:13:59 -08:00
8253pit.h
a.out.h
acpi.h ACPI: cleanup: make disable_acpi() valid w/o CONFIG_ACPI 2007-02-13 00:09:13 -05:00
agp.h
alternative-asm.i
alternative.h
apic.h [PATCH] i386: add command line option "local_apic_timer_c2_ok" 2007-03-23 10:21:02 -07:00
apicdef.h
arch_hooks.h
atomic.h [PATCH] Numerous fixes to kernel-doc info in source files. 2007-02-11 10:51:32 -08:00
auxvec.h
bitops.h [PATCH] Numerous fixes to kernel-doc info in source files. 2007-02-11 10:51:32 -08:00
boot.h
bug.h
bugs.h [PATCH] i386: improve sched_clock() on i686 2007-02-13 13:26:22 +01:00
byteorder.h
cache.h
cacheflush.h
checksum.h
cpu.h
cpufeature.h
cputime.h
current.h
debugreg.h
delay.h [PATCH] vmi: paravirt drop udelay op 2007-03-05 07:57:52 -08:00
desc.h [PATCH] i386: Rename cpu_gdt_descr and remove extern declaration from smpboot.c 2007-02-13 13:26:26 +01:00
device.h
div64.h
dma-mapping.h
dma.h
dmi.h
dwarf2.h
e820.h
edac.h
elf.h [PATCH] i386: clear segment register padding in core dumps 2007-03-23 15:32:58 -07:00
emergency-restart.h
errno.h
fcntl.h
fixmap.h [PATCH] Fix CONFIG_COMPAT_VDSO 2007-01-26 13:50:58 -08:00
floppy.h
frame.i
futex.h
genapic.h
hardirq.h
highmem.h
hpet.h [PATCH] clockevents: i386 drivers 2007-02-16 08:13:59 -08:00
hw_irq.h
hypertransport.h
i387.h
i8253.h [PATCH] clockevents: i386 drivers 2007-02-16 08:13:59 -08:00
i8259.h
ide.h
intel_arch_perfmon.h
io_apic.h [PATCH] io_apic.h needs apicdef.h 2007-03-05 07:57:50 -08:00
io.h [PATCH] kill eth_io_copy_and_sum() 2007-02-09 09:14:07 -08:00
ioctl.h
ioctls.h
ipc.h
ipcbuf.h
irq_regs.h
irq.h
irqflags.h
ist.h
k8.h
Kbuild
kdebug.h
kexec.h
kmap_types.h
kprobes.h
ldt.h
linkage.h
local.h
math_emu.h
mc146818rtc.h
mca_dma.h
mca.h
mce.h [PATCH] i386: Move mce_disabled to asm/mce.h 2007-02-13 13:26:26 +01:00
mman.h
mmu_context.h [PATCH] i386: Convert i386 PDA code to use %fs 2007-02-13 13:26:20 +01:00
mmu.h
mmx.h
mmzone.h
module.h
mpspec_def.h
mpspec.h [PATCH] clockevents: i386 drivers 2007-02-16 08:13:59 -08:00
msgbuf.h
msidef.h
msr.h Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq 2007-02-26 14:17:50 -08:00
mtrr.h
mutex.h
namei.h
nmi.h Disable NMI watchdog by default properly 2007-03-14 17:53:43 -07:00
numa.h
numaq.h
page.h [PATCH] Fix CONFIG_COMPAT_VDSO 2007-01-26 13:50:58 -08:00
param.h
paravirt.h [PATCH] fastcall still doesn't make sense in paravirt 2007-03-14 15:27:49 -07:00
parport.h
pci-direct.h
pci.h
pda.h [PATCH] i386: Convert i386 PDA code to use %fs 2007-02-13 13:26:20 +01:00
percpu.h
pgalloc.h [PATCH] MM: page allocation hooks for VMI backend 2007-02-13 13:26:21 +01:00
pgtable-2level-defs.h
pgtable-2level.h
pgtable-3level-defs.h
pgtable-3level.h
pgtable.h [PATCH] vmi: fix highpte 2007-03-05 07:57:52 -08:00
poll.h
posix_types.h
processor.h Revert "[PATCH] i386: add idle notifier" 2007-02-26 09:21:46 -08:00
ptrace-abi.h
ptrace.h [PATCH] i386: Profile pc badness 2007-02-13 13:26:21 +01:00
resource.h
rtc.h
rwlock.h
rwsem.h
scatterlist.h
seccomp.h
sections.h
segment.h [PATCH] i386: Profile pc badness 2007-02-13 13:26:21 +01:00
semaphore.h
sembuf.h
serial.h
setup.h [PATCH] i386: Remove extern declaration from mm/discontig.c, put in header. 2007-02-13 13:26:26 +01:00
shmbuf.h
shmparam.h
sigcontext.h
siginfo.h
signal.h
smp.h [PATCH] i386: SMP boot hook for paravirt 2007-02-13 13:26:21 +01:00
socket.h
sockios.h
sparsemem.h
spinlock_types.h
spinlock.h
srat.h
stacktrace.h
stat.h
statfs.h
string.h
suspend.h
sync_bitops.h [PATCH] i386: fix typo in sync_constant_test_bit()'s name 2007-03-16 19:25:07 -07:00
system.h
termbits.h
termios.h [PATCH] consolidate line discipline number definitions 2007-02-11 10:51:26 -08:00
therm_throt.h
thread_info.h
time.h [PATCH] vmi: pit override 2007-03-05 07:57:52 -08:00
timer.h [PATCH] vmi: cpu cycles fix 2007-03-05 07:57:52 -08:00
timex.h
tlb.h
tlbflush.h
topology.h [PATCH] sched: remove SMT nice 2007-03-05 07:57:51 -08:00
tsc.h [PATCH] i386: make x86_64 tsc header require i386 rather than vice-versa 2007-03-06 09:30:24 -08:00
types.h
uaccess.h [PATCH] fix sparse warnings from {asm,net}/checksum.h 2007-02-11 10:51:31 -08:00
ucontext.h
unaligned.h
unistd.h
unwind.h
user.h
vga.h
vic.h
vm86.h
vmi_time.h [PATCH] Fix vmi time header bug 2007-03-12 16:36:16 -07:00
vmi.h [PATCH] vmi: apic ops 2007-03-05 07:57:52 -08:00
voyager.h
xor.h