Skip to contentSkip to conversation

+ espfix-code-cleanup.patch added to -mm tree

DISCUSSION Chuck Ebbert 2 participants 2 messages Aug 1, 2006

lore
Share & tools
lore
#0 lore raw

In-Reply-To: <[email protected]>

Quoted 1 line · Andrew Morton

espfix-code-cleanup.patch

After the fixup code does this:

movl %esp, %eax # pt_regs pointer
movl %esp, %edx
call patch_espfix_gdt
pushl $__ESPFIX_SS
CFI_ADJUST_CFA_OFFSET 4
pushl %eax
CFI_ADJUST_CFA_OFFSET 4
==> lss (%esp), %esp
CFI_ADJUST_CFA_OFFSET -8
jmp restore_nocheck

we are on a ring0 32-bit stack that's not zero-based. If an exception occurs in that state, UNWIND_ESPFIX_STACK restores the proper kernel SS and ESP but on return from the exception nothing restores the espfix stack. I guess this isn't a problem now because exceptions in kernel mode are fatal but a kernel debugger might have problems here?

Signature · 1 line
Chuck
#1 lore raw

Hi.

Quoted 5 lines · Chuck Ebbert

we are on a ring0 32-bit stack that's not zero-based. If an exception occurs in that state, UNWIND_ESPFIX_STACK restores the proper kernel SS and ESP but on return from the exception nothing restores the espfix stack. I guess this isn't a problem now because exceptions in kernel mode are fatal but a kernel debugger might have problems here?

Perhaps you are right, but... unless there is some quick way to mark that part of code "undebuggable", I'll better leave that for the debugger maintainers to think about.