Closed
Description
I tried this code:
#![no_std]
#![feature(abi_x86_interrupt)]
#![feature(naked_functions)]
#[naked]
pub extern "x86-interrupt" fn page_fault_handler(_: u64, _: u64) {
unsafe {
core::arch::asm!("ud2", options(noreturn));
}
}
And compiled it with --target x86_64-unknown-none -Zsanitizer=kernel-address
.
I expected to see this happen: The compiler should generate a function page_fault_handler
which only contains the ud2
instruction.
Instead, this happened: The compiler crashes with SIGILL
.
Meta
rustc --version --verbose
:
rustc 1.82.0-nightly (506052d49 2024-08-16)
binary: rustc
commit-hash: 506052d49d3903ea554e4ce760cc53610cff4ef5
commit-date: 2024-08-16
host: x86_64-unknown-linux-gnu
release: 1.82.0-nightly
LLVM version: 19.1.0
As requested in #127853 (comment).
Metadata
Metadata
Assignees
Labels
Area: Concerning the application binary interface (ABI)Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: `#[naked]`, prologue and epilogue-free, functions, https://git.io/vAzzSArea: Sanitizers for correctness and code qualityCategory: This is a bug.`#![feature(naked_functions)]`Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Target: Rust without an operating systemTarget: x86-64 processors (like x86_64-*) (also known as amd64 and x64)Project group: Exploit mitigationsRelevant to the compiler team, which will review and decide on the PR/issue.