Skip to content

Call to VirtAddr::new() causes panic when CR2 does not contain a canonical address. #332

@RevolutionXenon

Description

@RevolutionXenon

https://docs.rs/x86_64/latest/src/x86_64/registers/control.rs.html#267

When CR2 contains a malformed address, this panic occurs:
"panicked at 'address passed to VirtAddr::new must not contain any data in bits 48 to 64"

CR2 can obviously contain a non-canonical address after a page fault. This panic should not occur. I'm not sure what the best fix would be, but I ran into this because I tried to print CR2 in my panic handler and it just starts looping when you do that.

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