]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
[POWERPC] Fix ppc64 makecontext() parameter overflow handling.
authorbdragon <bdragon@FreeBSD.org>
Thu, 6 Aug 2020 17:49:19 +0000 (17:49 +0000)
committerbdragon <bdragon@FreeBSD.org>
Thu, 6 Aug 2020 17:49:19 +0000 (17:49 +0000)
commitb5dbbcc83bd499f705d4a93eeaf752254114feff
treee4058f6265ee89f3233d991c2644d8c204c62a05
parent958ae09971562fff75af59511889393795a43837
[POWERPC] Fix ppc64 makecontext() parameter overflow handling.

On ELFv2, the overflow parameters in the stack frame are at a different offset
from sp than ELFv1. Adjust code to use the correct offset in all cases.

This had resulted in argv[8] and up being copied to the incorrect address
in the new context's initial stack frame.

This is not necessarily the only bug in this function, I need to do a full
review still and ensure the rest of the math is sane for ELFv2 stack frames.

Reported by: pherde (Probably. My notes are a bit unclear.)
Reviewed by: jhibbits (in irc)
Sponsored by: Tag1 Consulting, Inc.
lib/libc/powerpc64/gen/makecontext.c