-
Notifications
You must be signed in to change notification settings - Fork 111
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
user backtrace fix #291
base: main
Are you sure you want to change the base?
user backtrace fix #291
Conversation
Changed it from no backtrace prints to a warning. |
if (thread->user_registers_->rbp % sizeof(pointer)) | ||
{ | ||
debug(BACKTRACE, "stack not aligned. this could cause serious problems\n"); | ||
return 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this return intentionally here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left it in by mistake.
already removed it
Made a small mistake there. with correct 16 byte alignment the old code was fine. |
checkAddressValid panics when given a non-canonical address due to the new assert in resolveMapping.
A user could trigger this by crashing with a non-canonical address in rbp.
Add an extra check in checkAddressValid since it should never assert.
An incorrectly aligned user-space stack could make the user backtrace function read from an incorrect page in the identity mapping. This can lead to a crash due to a read from non-existing physical memory.