HomeFreeBSD

amd64 ia32_syscall(): only allow for ILP32 processes

Description

amd64 ia32_syscall(): only allow for ILP32 processes

64bit processes can issue INT $0x80 instruction, and get the syscall
dispatched through ia32_syscall(). This works because syscall argument
fetch and result return are selected from the process sysent.

But, ia32_syscall() does not verify some conditions and does not perform
some actions which are considered unnecessary because the caller is
supposed to only access lower 4G. The INT syscall path breaks this
assumption.

We never supported such hack, so disable it. Send the offending thread
SIGBUS as if #GP was issued by hardware due to IDT vector 0x80 having
not numerically high enough DPL value.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D56630

Details

Provenance
kibAuthored on Apr 25 2026, 9:49 AM
Reviewer
markj
Differential Revision
D56630: amd64 ia32_syscall(): only allow for ILP32 processes
Parents
rG912f9dfca451: amd64: ia32_fetch_syscall_args() does not need to check params != NULL
Branches
Unknown
Tags
Unknown