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)
Feb 25 2024, 2:23 AM
Unknown Object (File)
Dec 20 2023, 7:42 AM
Unknown Object (File)
Aug 11 2023, 1:21 AM
Unknown Object (File)
Jul 27 2023, 12:35 AM
Unknown Object (File)
Jun 27 2023, 7:00 PM
Unknown Object (File)
Jun 14 2023, 1:20 PM
Unknown Object (File)
May 14 2023, 6:34 PM
Unknown Object (File)
May 5 2023, 11:56 PM
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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable