Page MenuHomeFreeBSD

powerpc: Only worry about the lower 32 bits of SP in a 32-bit process
ClosedPublic

Authored by jhibbits on Jul 9 2019, 10:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 17 2025, 5:44 AM
Unknown Object (File)
Jan 4 2025, 11:09 AM
Unknown Object (File)
Dec 21 2024, 2:38 AM
Unknown Object (File)
Dec 3 2024, 8:04 AM
Unknown Object (File)
Nov 29 2024, 7:14 PM
Unknown Object (File)
Nov 2 2024, 7:51 PM
Unknown Object (File)
Oct 4 2024, 2:12 PM
Unknown Object (File)
Oct 2 2024, 7:22 AM
Subscribers

Details

Summary

Running a 32-bit process on a 64-bit POWER CPU may still use all 64-bits
in calculations, while ignoring the upper 32 bits for addressing
storage. It so happens that some processes end up with r1 (SP) having
bit 31 set in some cases (33-bit address). Writing out to this 33-bit
address obviosly fails. Since the CPU ignores the upper bits, we should
as well.

sendsig() and cpu_fetch_syscall_args() appear to be the only functions
that actually rely on userspace register values for copy in/out, and
cpu_fetch_syscall_args() doesn't seem to be bitten in practice yet.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 25270
Build 23937: arc lint + arc unit