Page MenuHomeFreeBSD

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

Authored by jhibbits on Jul 9 2019, 10:00 PM.



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

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jhibbits created this revision.Jul 9 2019, 10:00 PM
luporl accepted this revision.Jul 10 2019, 1:48 PM

Nice catch!

This revision is now accepted and ready to land.Jul 10 2019, 1:48 PM