Skip to content

Detect exception/interrupt stack overflow #1339

Open
@wkozaczuk

Description

@wkozaczuk

When testing some Makefile changes with debug build on Fedora 37 with GCC 12, I discovered that OSv crashes or hangs in many scenarios. After some digging, I found the culprit lies in too small interrupt stack which is only 1 page large on x86_64 - probably the code generated with -O0 needs larger stack. Increasing the interrupt stack to 2 pages fixes the issue.

Given how small the interrupt stack is, we probably could at least introduce some "canary"-based type of solution similar to what we employ with the small syscall stack. Right after handling an interrupt in the interrupt() routing (see arch/x64/exceptions.cc) we could check the canary value and abort if overflow is detected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions