Skip to content

x86 reports incorrect stack pointer for user mode exceptions #13413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andrewboie opened this issue Feb 14, 2019 · 0 comments
Closed

x86 reports incorrect stack pointer for user mode exceptions #13413

andrewboie opened this issue Feb 14, 2019 · 0 comments
Labels
area: Memory Protection bug The issue is a bug, or the PR is fixing a bug

Comments

@andrewboie
Copy link
Contributor

andrewboie commented Feb 14, 2019

The stack pointer being shown when a user thread gets an exception is on the kernel-mode stack, because _exception_enter doesn't take into account the automatic stack switch done by the CPU (as defined in the TSS) when an interrupt causes a privilege elevation.

Consequence is that the ESP value reported for such exceptions is wrong, an annoyance for debugging and also confounds logic to determine whether a stack overflow occurred. The exception is processed by the CPU properly.

This bug has been with us for a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Memory Protection bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

No branches or pull requests

1 participant