summaryrefslogtreecommitdiff
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
...
* warnx: Save errno across calls that might change it.Warner Losh2020-10-231-0/+8
| | | | | | | | | | | | | | | When warn() family of functions is being used after err_set_file() has been set to, for example, /dev/null, errno is being clobbered, rendering it unreliable after, for example, procstat_getpathname() when it is supposed to emit a warning. Then the errno is changed to Inappropriate ioctl for device, destroying the original value (via calls to fprintf()functions). Submitted by: Juraj Lutter Differential Revision: https://reviews.freebsd.org/D26871 Notes: svn path=/head/; revision=366982
* Only use ASAN when using the in-tree compilerBrooks Davis2020-10-231-1/+3
| | | | | | | | | | | | | | When building FreeBSD 11 on a FreeBSD 12 system with CROSS_TOOLCHAIN=llvm10 we end up trying to link against the packaged version of the sanitizer library. This resulted in a requirement for getentropy(3) which is not present in FreeBSD 11. Reviewed by: emaste MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D26903 Notes: svn path=/head/; revision=366981
* mmap(2): Document guard size for MAP_STACK and related EINVAL.Konstantin Belousov2020-10-211-1/+8
| | | | | | | | | | | Based on submission by: emaste Reviewed by: emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D26894 Notes: svn path=/head/; revision=366918
* Further refinements of ptsname_r(3) interface:Xin LI2020-10-202-6/+8
| | | | | | | | | | | | | | | | | - Hide ptsname_r under __BSD_VISIBLE for now as the specification is not finalized at this time. - Keep Symbol.map sorted. - Avoid the interposing of ptsname_r(3) from an user application from breaking ptsname(3) by making the implementation a static method and call the static function from ptsname(3) instead. Reported by: kib Reviewed by: kib, jilles MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D26845 Notes: svn path=/head/; revision=366866
* Implement ptsname_r.Xin LI2020-10-174-16/+66
| | | | | | | | | | MFC after: 2 weeks PR: 250062 Reviewed by: jilles, 0mp, Ray <i maskray me> Differential Revision: https://reviews.freebsd.org/D26647 Notes: svn path=/head/; revision=366781
* libc: typo fix (s/involes/involves)Kyle Evans2020-10-161-1/+1
| | | | | | | | Reported by: Masahiko Sawada via twitter MFC after: 3 days Notes: svn path=/head/; revision=366770
* Fix building on Linux/macOS after r366622Alex Richardson2020-10-122-1/+13
| | | | | | | | | | | We have to bootstrap arc4random.c, so guard the FenestrasX code to avoid using it on Linux/macOS. Reviewed By: cem Differential Revision: https://reviews.freebsd.org/D26738 Notes: svn path=/head/; revision=366632
* random(4) FenestrasX: Push root seed version to arc4random(3)Conrad Meyer2020-10-103-0/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | Push the root seed version to userspace through the VDSO page, if the RANDOM_FENESTRASX algorithm is enabled. Otherwise, there is no functional change. The mechanism can be disabled with debug.fxrng_vdso_enable=0. arc4random(3) obtains a pointer to the root seed version published by the kernel in the shared page at allocation time. Like arc4random(9), it maintains its own per-process copy of the seed version corresponding to the root seed version at the time it last rekeyed. On read requests, the process seed version is compared with the version published in the shared page; if they do not match, arc4random(3) reseeds from the kernel before providing generated output. This change does not implement the FenestrasX concept of PCPU userspace generators seeded from a per-process base generator. That change is left for future discussion/work. Reviewed by: kib (previous version) Approved by: csprng (me -- only touching FXRNG here) Differential Revision: https://reviews.freebsd.org/D22839 Notes: svn path=/head/; revision=366622
* Fix a few mandoc issuesGordon Bergling2020-10-096-8/+10
| | | | | | | | | | - skipping paragraph macro: Pp after Sh - sections out of conventional order: Sh EXAMPLES - whitespace at end of input line - normalizing date format Notes: svn path=/head/; revision=366583
* newlocale(3): Fix a memory leak.Mark Johnston2020-10-022-2/+19
| | | | | | | | | | | | | | | | | | | | | newlocale() optionally takes a "base" locale, from which components not specified in the mask are inherited. POSIX says that newlocale() may modify "base" and return it, or free "base" and return a newly allocated locale. We were not doing either, so applications which use newlocale() to modify an existing base locale end up leaking memory on FreeBSD. This diff fixes the leak by releasing a reference to the base locale before returning. This is less efficient than modifying "base" directly, but is simpler for an initial bug fix. Also, update the man page to clarify behaviour with respect to "base". PR: 249416 MFC after: 3 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26522 Notes: svn path=/head/; revision=366375
* auxv: partially revert r366207, cast buflen to unsigned int as neededKyle Evans2020-10-011-17/+15
| | | | | | | | | | | | | | | | | | | | | | | The warning generated pre-r366207 is actually a sign comparison warning: error: comparison of integers of different signs: 'unsigned long' and 'int' if (strlcpy(buf, execpath, buflen) >= buflen) Revert parts that affected other lines and just cast this to unsigned int. The buflen < 0 -> EINVAL has been kept despite no longer serving any purposes w.r.t. sign-extension because I do believe it's the right thing to do: "The provided buffer was not the right size for the requested item." The original warning is confirmed to still be gone with an: env WARNS=6 make WITHOUT_TESTS=yes. Reviewed by: asomers, kib X-MFC-With: r366207 Differential Revision: https://reviews.freebsd.org/D26631 Notes: svn path=/head/; revision=366342
* Eliminate duplicate `afterinstallconfigs` targetEnji Cooper2020-10-012-2/+4
| | | | | | | | | | | | | | | | | Define separate dependent targets which `afterinstallconfigs` relies on, in order to modify `${DESTDIR}/etc/master.passwd` and `${DESTDIR}/etc/nsswitch.conf`. Mark these targets .PHONY, since they manipulate configurations on the fly and the generation logic isn't 100% defined in terms of the source files/logic, and is variable, based on MK_foo flags. MFC after: 2 weeks Reviewed by: bapt, brd Differential Revision: https://reviews.freebsd.org/D20330 Notes: svn path=/head/; revision=366327
* Updates to chroot(2) docsWarner Losh2020-09-291-2/+9
| | | | | | | | 1. Note what settings give historic behavior 2. Recommend jail under security considerations. Notes: svn path=/head/; revision=366266
* Misc compiler warning fixes in lib/libcAlan Somers2020-09-277-17/+36
| | | | | | | | | Reviewed by: kevans, imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D26534 Notes: svn path=/head/; revision=366207
* lib/libc/tests/iconv: raise WARNS to 6Alan Somers2020-09-242-2/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=366132
* lib/libc/tests/sys: raise WARNS to 6Alan Somers2020-09-241-6/+0
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=366131
* [PowerPC64LE] Fix gdtoa configurations on LE.Brandon Bergren2020-09-232-0/+9
| | | | | | | | | | | | | | | | gdtoa wins the award for "most outdated endianness naming convention" with its IEEE_8087 vs IEEE_MC68k defines. I had a good chuckle. Update softfloat and arith.h to adjust to BE or LE automatically based on the low level preprocessor defines. Fixes printf/scanf on PowerPC64LE, although there is still a problem lurking regarding Signalling NaNs... Sponsored by: Tag1 Consulting, Inc. Notes: svn path=/head/; revision=366054
* [PowerPC64LE] Use a shared LIBC_ARCH for powerpc64le.Brandon Bergren2020-09-232-5/+10
| | | | | | | | | | | | | | | Given that we have converted to ELFv2 for BE already, endianness is the only difference between the two ARCHs. As such, there is no need to differentiate LIBC_ARCH between the two. Combining them like this lets us avoid needing to have two copies of several bits for no good reason. Sponsored by: Tag1 Consulting, Inc. Notes: svn path=/head/; revision=366039
* Document {O,AT}_RESOLVE_BENEATH and new O_BENEATH behavior for relative paths.Konstantin Belousov2020-09-2211-15/+113
| | | | | | | | | | | | PR: 248335 Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D25886 Notes: svn path=/head/; revision=366023
* fix integer underflow in getgrnam_r and getpwnam_rAlan Somers2020-09-192-4/+24
| | | | | | | | | | | | | | | | | | | Sometimes nscd(8) will return a 1-byte buffer for a nonexistent entry. This triggered an integer underflow in grp_unmarshal_func, causing getgrnam_r to return ERANGE instead of 0. Fix the user's buffer size check, and add a correct check for a too-small nscd buffer. PR: 248932 Event: September 2020 Bugathon Reviewed by: markj MFC after: 2 weeks Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D26204 Notes: svn path=/head/; revision=365910
* build: provide a default WARNS for all in-tree buildsKyle Evans2020-09-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The current default is provided in various Makefile.inc in some top-level directories and covers a good portion of the tree, but doesn't cover parts of the build a little deeper (e.g. libcasper). Provide a default in src.sys.mk and set WARNS to it in bsd.sys.mk if that variable is defined. This lets us relatively cleanly provide a default WARNS no matter where you're building in the src tree without breaking things outside of the tree. Crunchgen has been updated as a bootstrap tool to work on this change because it needs r365605 at a minimum to succeed. The cleanup necessary to successfully walk over this change on WITHOUT_CLEAN builds has been added. There is a supplemental project to this to list all of the warnings that are encountered when the environment has WARNS=6 NO_WERROR=yes: https://warns.kevans.dev -- this project will hopefully eventually go away in favor of CI doing a much better job than it. Reviewed by: emaste, brooks, ngie (all earlier version) Reviewed by: emaste, arichardson (depend-cleanup.sh change) Differential Revision: https://reviews.freebsd.org/D26455 Notes: svn path=/head/; revision=365887
* Fix error checking in shm_create_largepage().Mark Johnston2020-09-181-1/+1
| | | | | | | | | | Reviewed by: alc, kib Reported by: Coverity MFC with: r365524 Differential Revision: https://reviews.freebsd.org/D26464 Notes: svn path=/head/; revision=365877
* memfd_create: simplify HUGETLB support a little bitKyle Evans2020-09-111-45/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | This also fixes a minor issue that was missed in the initial review; the layout of the MFD_HUGE_* flags is actually not 1:1 bit:flag -- it instead borrowed the Linux convention of how this is laid out since it was originally implemented on Linux, the top 6 bits represent the shift required for the requested page size. This allows us to remove the flag <-> pgsize mapping table and simplify the logic just prior to validation of the requested page size. While we're here, fix two small nits: - HUGETLB memfd shouldn't exhibit the SHM_GROW_ON_WRITE behavior. We can only grow largepage shm by appropriately aligned (i.e. requested pagesize) sizes, so it can't work in the typical/sane fashion. Furthermore, Linux does the same, so let's be compatible. - We don't allow MFD_HUGETLB without specifying a pagesize, so no need to check for that later. Reviewed by: kib (slightly earlier version) Notes: svn path=/head/; revision=365624
* memfd_create: fix return valuesKyle Evans2020-09-101-8/+16
| | | | | | | | | | Literally returning EINVAL from a function designed to return an fd makes for interesting scenarios. I cannot assign enough pointy hats to cover this one. Notes: svn path=/head/; revision=365615
* Fix memfd_create tests after r365524Kyle Evans2020-09-101-1/+1
| | | | | | | | | | | | r365524 did accidentally invert this check that sets SHM_LARGEPAGE, leading non-hugetlb memfd as unconfigured largepage shm and thus test failures when we try to ftruncate or write to them. PR: 249236 Discussed with: kib Notes: svn path=/head/; revision=365593
* Add shm_create_largepage(3) helper for creation and configuration ofKonstantin Belousov2020-09-092-8/+109
| | | | | | | | | | | | | | | | largepage shm objects. And since we can, add memfd_create(MFD_HUGETLB) support, hopefully close enough to the Linux feature. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24652 Notes: svn path=/head/; revision=365524
* getlogin_r: fix the type of lenKyle Evans2020-09-093-4/+14
| | | | | | | | | | | | | | | | | | | | | | getlogin_r is specified by POSIX to to take a size_t len, not int. Fix our version to do the same, bump the symbol version due to ABI change and provide compat. This was reported to break compilation of Ruby 2.8. Some discussion about the necessity of the ABI compat did take place in the review. While many 64-bit platforms would likely be passing it in a 64-bit register and zero-extended and thus, not notice ABI breakage, some do sign-extend (e.g. mips). PR: 247102 Submitted by: Bertram Scharpf <software@bertram-scharpf.de> (original) Submitted by: cem (ABI compat) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26335 Notes: svn path=/head/; revision=365506
* libc tests: dynthr_mod: fix some WARNS issuesKyle Evans2020-09-091-1/+3
| | | | | | | | | | | | | | This is being addressed as part of a side-patch I'm working on that builds all the things with WARNS=6, instead of relying on it being supplied in just shallow parts of the build with higher-level Makefile.inc. Provide a prototype for mod_main and annotate the thread function argument as unused. MFC after: 1 week Notes: svn path=/head/; revision=365494
* libc/resolv: attempt to fix the test under WARNS=6Kyle Evans2020-09-091-15/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In a side-change that I'm working on to start defaulting src builds to WARNS=6 where WARNS isn't otherwise specified, GCC6 (and clang, to a lesser extent) pointed out a number of issues with the resolv tests: - Global method variable that gets shadowed in run_tests() - Signed/unsigned comparison between i in run_tests() and hosts->sl_cur The shadowed variable looks like it might actually be bogus as written, as we pass it to RUN_TESTS -> run_tests, but other parts use the global method instead. This change is mainly geared towards correcting that by removing the global and plumbing the method through from run_tests -> run into the new thread. For the signed/unsigned comparison, there's no compelling reason to not just switch i/nthreads/nhosts to size_t. The review also included a change to the load() function that was better addressed by jhb in r365302. Reviewed by: ngie, pstef MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D24844 Notes: svn path=/head/; revision=365493
* [PowerPC] Implement VDSO timebase access on powerpc*Brandon Bergren2020-09-087-5/+135
| | | | | | | | | | | | | | | | | Implement the remaining pieces needed to allow userland timestamp reading. Rewritten based on an intial essay into the problem by Justin Hibbits. (Copyright changed to my own on his request.) Tested on ppc64 (POWER9 Talos II), powerpcspe (e500v2 RB800), and powerpc (g4 PowerBook). Reviewed by: jhibbits (in irc) Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D26347 Notes: svn path=/head/; revision=365442
* Follow-up r365371 by removing sentences which indicate the state of theDimitry Andric2020-09-061-1/+1
| | | | | | | | | | | | | MK_MALLOC_PRODUCTION option on -CURRENT. Also, for the sake of backwards compatibility, support the old way of enabling 'production malloc', e.g. by adding a define in make.conf(5). MFC after: 1 week X-MFC-With: r365371 Notes: svn path=/head/; revision=365373
* Turn MALLOC_PRODUCTION into a regular src.conf(5) optionDimitry Andric2020-09-051-1/+1
| | | | | | | | | | | | | | | | | | For historical reasons, defining MALLOC_PRODUCTION in /etc/make.conf has been used to turn off potentially expensive debug checks and statistics gathering in the implementation of malloc(3). It seems more consistent to turn this into a regular src.conf(5) option, e.g. WITH_MALLOC_PRODUCTION / WITHOUT_MALLOC_PRODUCTION. This can then be toggled similar to any other source build option, and turned on or off by default for e.g. stable branches. Reviewed by: imp, #manpages MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26337 Notes: svn path=/head/; revision=365371
* Various fixes to the load() function.John Baldwin2020-09-031-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | - Use getline() instead of fgetln(). This ensures the returned string is always null-terminated without losing the last character if the last line in a file doesn't have a newline. Also, while fgetln says the returned buffer can be modified, that doesn't actually seem safe as the current implementation means you are modifying stdio's internal buffer. - Remove a spurious if before an ATF_REQUIRE that was clearly supposed to be non-optional. - Remove a pointless compare of 'ptr' against '\0' (really NULL) that duplicated the middle condition in the for(). - Once a comment is found, skip the rest of the line, not just the current word. Reviewed by: kevans Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26278 Notes: svn path=/head/; revision=365302
* Pass a valid mode with O_CREATE to open(2).John Baldwin2020-09-021-6/+6
| | | | | | | | | | | | | | | CheriABI is pickier about the arguments to open(2) and crashes with a fault if a mode isn't passed to an open() when O_CREATE is specified. Reported by: CHERI Reviewed by: brooks Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26281 Notes: svn path=/head/; revision=365280
* Don't assume objects in program sections have a size of a pointer.John Baldwin2020-09-021-1/+1
| | | | | | | | | | | | | | | | | The size of the object at 'addr' is unknown and might be smaller than the size of a pointer (e.g. some x86 instructions are smaller than a pointer). Instead, just check that the address is in the bounds of the program header. Reported by: CHERI (indirectly) Reviewed by: kib, brooks Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26279 Notes: svn path=/head/; revision=365278
* Compute the correct size of the string to move forward.John Baldwin2020-09-021-1/+1
| | | | | | | | | | | | | | | | | | | | Previously this was counting the amount of spare room at the start of the buffer that the string needed to move forward and passing that as the number of bytes to copy to memmove rather than the length of the string to be copied. In the strfmon test in the test suite this caused the memmove to overflow the allocated buffer by one byte which CHERI caught. Reported by: CHERI Reviewed by: kevans Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26280 Notes: svn path=/head/; revision=365276
* Include the psind in data returned by mincore(2).Mark Johnston2020-09-021-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | Currently we use a single bit to indicate whether the virtual page is part of a superpage. To support a forthcoming implementation of non-transparent 1GB superpages, it is useful to provide more detailed information about large page sizes. The change converts MINCORE_SUPER into a mask for MINCORE_PSIND(psind) values, indicating a mapping of size psind, where psind is an index into the pagesizes array returned by getpagesizes(3), which in turn comes from the hw.pagesizes sysctl. MINCORE_PSIND(1) is equal to the old value of MINCORE_SUPER. For now, two bits are used to record the page size, permitting values of MAXPAGESIZES up to 4. Reviewed by: alc, kib Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26238 Notes: svn path=/head/; revision=365267
* Fix a buffer overrun.John Baldwin2020-09-011-3/+3
| | | | | | | | | | | | | | getln() returns 'len' valid characters. line[len] is out of bounds. Reported by: CHERI Reviewed by: brooks Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26197 Notes: svn path=/head/; revision=365055
* Fix the build of scandir_b with GCC.John Baldwin2020-08-311-4/+7
| | | | | | | | | | | Use explicit typedefs for block thunk structures as in r264143. Reviewed by: kib, adrian MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26256 Notes: svn path=/head/; revision=365012
* Add missing FreeBSD functions to -legacy when building on macOS/LinuxAlex Richardson2020-08-251-1/+3
| | | | | | | | | | | | | | | | In most cases this simply builds the file from lib/libc for missing functions (e.g. strlcpy on Linux etc.). In cases where this is not possible I've added an implementation to tools/build/cross-build. The fgetln.c/fgetwln.c/closefrom.c compatibility code was obtained from https://gitlab.freedesktop.org/libbsd/libbsd, but I'm not sure it makes sense to import it into to contrib just for these three bootstrap files. Reviewed By: brooks Differential Revision: https://reviews.freebsd.org/D25978 Notes: svn path=/head/; revision=364759
* libc: hide alphasort_thunk behind I_AM_SCANDIR_BMateusz Guzik2020-08-231-0/+2
| | | | | | | | Should unbreak gcc build as reported by tinderbox: lib/libc/gen/scandir.c:59:12: warning: 'alphasort_thunk' declared 'static' but never defined [-Wunused-function] Notes: svn path=/head/; revision=364500
* dl_iterate_phdr(3): provide exclusive locking for callback when statically ↵Konstantin Belousov2020-08-201-2/+8
| | | | | | | | | | | | | | | linked. Apparently llvm unwinder depends on the external locking for callback. Reviewed by: cem, emaste Tested by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D26109 Notes: svn path=/head/; revision=364423
* scandir-compat11.c: Remove unused declaration for qsort_b().Konstantin Belousov2020-08-171-2/+0
| | | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 0 days Notes: svn path=/head/; revision=364322
* Don't explicitly specify c99 or gnu99 as the default is now gnu99.Xin LI2020-08-171-2/+0
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=364292
* syslog(3): Send proper NILVALUE if gethostname(3) fails.Bryan Drewery2020-08-141-7/+16
| | | | | | | | | | | | RFC5424 defines NILVALUE as '-'. Replace its usage with a macro and separate out the fields to be more clear. fputs(3) is used in some places to avoid hiding possible format string problems in a macro. Reviewed by: cem, vangyzen (earlier version) Sponsored by: Dell EMC Notes: svn path=/head/; revision=364223
* Export scandir_b from libc.Konstantin Belousov2020-08-104-25/+14
| | | | | | | | | | | | | | | | | | Apparently it was not exported, because scandir_b.c was not included into libc SRCS. Export it with the CURRENT-13 version. Also, because it was not exported before ino64, clean up scandir-compat11.c. PR: 248572 Reported by: Alex S <iwtcex@gmail.com> Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D26020 Notes: svn path=/head/; revision=364091
* setlocale(3): Add an EXAMPLES section and add LANG categoryGordon Bergling2020-08-071-1/+24
| | | | | | | | | | PR: 41824 Submitted by: Slaven Rezic <eserte atvran dot herceg dot de> Obtained from: NetBSD MFC after: 1 week Notes: svn path=/head/; revision=364032
* mbsrtowcs(3): Clarify the RETURN VALUES sectionGordon Bergling2020-08-071-4/+18
| | | | | | | | | PR: 215848 Submitted by: Andrew Stevenson <andrew at ugh dot net dot au> MFC after: 1 week Notes: svn path=/head/; revision=364031
* tmpnam(3): Also mention tmpfile in the ENVIRONMENT sectionGordon Bergling2020-08-071-1/+3
| | | | | | | | | PR: 181785 Submitted by: Kevin P. Neal <kpneal atpobox dot com> MFC after: 1 week Notes: svn path=/head/; revision=364029
* [POWERPC] Fix ppc64 makecontext() parameter overflow handling.Brandon Bergren2020-08-061-0/+4
| | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=363972