| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On PowerPC platforms a valid link to the Table of Contents (TOC) is
required for PLT lookups to function. This TOC pointer is stored in
a dedicated register, and is used along with the stack pointer by both
C prologue and PLT lookup code.
When calling swapcontext() with uc_link != NULL, a PLT lookup to
setcontext(3) is attempted from within the _ctx_done context. The
exiting process has usually trashed both r1 and r2 at this point,
leading to a crash within the PLT lookup before setcontext(2) is
reached to restore the linked context.
Save and restore r2 as in a regular function. This ensures the
subsequent PLT lookup to setcontext(3) succeeds.
Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com>
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/1759
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now that dd_size is unsigned, we need to check if the return value from
getdirentries() was negative before assigning it to dd_size.
While here, simplify the scandir_error test case slightly, and verify
that calling readdir() again after EOF still returns NULL.
Fixes: 42e613018da5
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D51266
|
|
|
|
|
|
|
| |
This private API is no longer used by rtld-elf so can be removed.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D50921
|
|
|
|
|
|
|
|
| |
Use either size_t or off_t (as appropriate) instead of long.
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D51210
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is both more logical and more useful than EINVAL.
While here, also check for VBAD and return EBADF in that case. This can
happen if the underlying filesystem got forcibly unmounted after the
directory was opened. Previously, this would also have returned EINVAL,
which wasn't right but wasn't wrong either; however, ENOTDIR would not
be appropriate.
MFC after: never
Sponsored by: Klara, Inc.
Reviewed by: kevans, kib
Differential Revision: https://reviews.freebsd.org/D51209
|
|
|
|
|
|
|
|
|
|
| |
These only existed for a few days before being renamed, so there's no
reason to continue to carry compatibility shims for them.
Fixes: deeebfdecab5
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D50981
|
|
|
|
|
|
|
| |
Fixes: da2025a0e894
Sponsored by: Klara, Inc.
Reviewed by: bcr
Differential Revision: https://reviews.freebsd.org/D51208
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the calling process has used SIG_IGN as handler or set the
SA_NOCLDWAIT flag for SIGCHLD, processes will be automatically reaped on
exit and calls to waitpid(3) will therefore fail with ECHILD.
We waitpid primarily to reap our child so that the caller does not have
to worry about it. ECHILD indicates that there is no child to reap, so
we can just treat that as a success and move on.
Signed-off-by: Kenny Levinsen <kl@kl.wtf>
Tested by: Jan Beich
Pull Request: https://github.com/freebsd/freebsd-src/pull/1675
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add test cases for opendir() and fdopendir().
* Drop O_NONBLOCK from opendir(); it was added a long time ago to avoid
blocking if given a closed named pipe, but now we use O_DIRECTORY,
which ensures that we get ENOTDIR in that case.
* While here, remove unused #includes left over from the split.
Sponsored by: Klara, Inc.
Reviewed by: kevans, markj
Differential Revision: https://reviews.freebsd.org/D51126
|
|
|
|
|
|
|
|
|
|
| |
__uexterr_format: return empty string on no error, instead of "No error"
err(): check for the first symbol of the exterr to decide if there is
anything to print.
Requested and reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D51204
|
|
|
|
|
|
| |
Reviewed by: kib, markj
MFC after: 1 month
Pull Request: https://github.com/freebsd/freebsd-src/pull/1758
|
|
|
|
|
|
| |
Reviewed by: asomers, brooks
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D51141
|
|
|
|
|
|
|
|
|
|
|
| |
If the extended error string is provided by kernel, return only the
string, which is supposedly enough to identify exact cause of the error.
If the string is not provided, print the technically looking gibberish
which still allows to identify location with kernel sources.
Reviewed by: asomers, brooks
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D51141
|
|
|
|
|
|
| |
Reviewed by: kib
MFC after: 1 month
Pull Request: https://github.com/freebsd/freebsd-src/pull/1698
|
|
|
|
|
|
| |
Reviewed by: kib
MFC after: 1 month
Pull Request: https://github.com/freebsd/freebsd-src/pull/1698
|
|
|
|
|
|
|
|
|
|
| |
inotify_init() and inotify_init1() are implemented using __specialfd(2).
inotify_add_watch() is implemented in terms of inotify_add_watch_at(2).
Reviewed by: kib
MFC after: 3 months
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D50315
|
|
|
|
|
|
| |
Sponsored by: Klara, Inc.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D51118
|
|
|
|
|
|
| |
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D51098
|
|
|
|
|
|
| |
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D51097
|
|
|
|
|
|
| |
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D51050
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, if `readdir()` fails, `scandir()` simply returns a partial
result (or a null result if it fails before any entries were selected).
There is no way within the current API design to return both a partial
result and an error indicator, so err on the side of caution: if an
error occurs, discard any partial result and return the error instead.
MFC after: 1 week
Reported by: Maxim Suhanov <dfirblog@gmail.com>
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D51046
|
|
|
|
|
|
|
|
|
| |
Reported by: Greg Becker <greg.becker@klarasystems.com>
Reviewed by: emaste, kevans, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Also see: https://reviews.freebsd.org/D50998
Differential revision: https://reviews.freebsd.org/D50997
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This seems to fit the pattern better (e.g. fdopendir()).
I've added weak references to ease the transition, but since it's only
been a few days, we can remove them (and the ObsoleteFiles entries for
the manual pages) before we branch stable/15.
Fixes: deeebfdecab5
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D50980
|
|
|
|
| |
Sponsored by: Klara, Inc.
|
|
|
|
|
| |
Fixes: 1e0743f54d2d
Sponsored by: Klara, Inc.
|
|
|
|
|
|
|
|
|
|
|
| |
Most importantly, they need to run without privileges, since root is
allowed to read a directory regardless of its permission bits.
PR: 287694
Fixes: 4d7c31bca252
Sponsored by: Klara, Inc.
Reviewed by: bnovkov
Differential Revision: https://reviews.freebsd.org/D50965
|
|
|
|
| |
CID: 1591126
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the previous commit, I removed the initial initialization of the
`names` array, not realizing that `scandir()` is expected to return
a non-null (but empty) array of entries if no entries matched.
Restore the historical behavior, document it, and add a test.
Fixes: deeebfdecab5
Sponsored by: Klara, Inc.
Reviewed by: kevans, allanjude, markj
Differential Revision: https://reviews.freebsd.org/D50949
|
|
|
|
|
|
|
|
|
| |
While here, clean up scandir() a bit and improve the documentation.
MFC after: never
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D50935
|
|
|
|
| |
Reviewed by: glebius
|
|
|
|
|
|
|
| |
Switch all instances of the -isoC-2024 macro to -isoC-2023 selected by
upstream. Keep -isoC-2024 defined, but deprecated, for backwards compat.
MFC after: 3 days (I will resolve merge conflicts with cdefs)
|
|
|
|
|
|
|
|
| |
sig2str(3)
Reviewed by: imp, kib, des, jilles
Pull Request: https://github.com/freebsd/freebsd-src/pull/1696
Closes: https://github.com/freebsd/freebsd-src/pull/1696
|
|
|
|
|
| |
Reviewed by: imp, kib, des, jilles
Pull Request: https://github.com/freebsd/freebsd-src/pull/1696
|
|
|
|
|
|
| |
Signed-off-by: Ricardo Branco <rbranco@suse.de>
Reviewed by: imp, kib, des, jilles
Pull Request: https://github.com/freebsd/freebsd-src/pull/1696
|
|
|
|
|
|
|
| |
Signed-off-by: Ricardo Branco <rbranco@suse.de>
Reviewed by: imp, kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/1710
Closes: https://github.com/freebsd/freebsd-src/pull/1710
|
|
|
|
|
|
|
|
| |
close_range(2) was added prior to 13.0. There is no need to support
a new userspace on such an old kernel.
Reviewed by: kevans, imp
Differential Revision: https://reviews.freebsd.org/D50730
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows userspace to run on a (somewhat) out of date kernel.
Avoid a __FreeBSD_version bump and use the bump from a02180cf60a6 which
has occured since exterrctl was added.
Reviewed by: kevans
Fixes: b9c8a07d4dd9 ("C runtime: enable extended error reporting from kernel")
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D50687
|
|
|
|
|
|
|
|
|
|
| |
We don't expose the dummy struct pointer in the header file, so
gl_errblk is just a void * when lacking compiler support for blocks and
we need to cast to the former for CALL_BLOCK to work. If blocks support
is present this should be a redundant cast to the type that gl_errblk
already is.
Fixes: 1e0743f54d2d ("glob: Add blocks support")
|
|
|
|
|
|
|
|
|
| |
For the case where the compiler supports blocks we only allow the first
expression to have an operator if it has as high precedence as a
function call, which for blocks effectively means member access and
subscripting only, not even a dereference nor a cast. Parenthesise this,
as is the case for the missing compiler support case, so that it's more
general.
|
|
|
|
|
|
|
|
|
| |
This change adds tests that check basic callback functionality for
blocks and function pointers. The tests also make sure that GLOB_ERR
overrides the callback's return value.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D50486
|
|
|
|
|
|
|
|
|
|
| |
This change introduces the `glob_b` function which takes a block instead
of a function pointer.
Relnotes: yes
Sponsored by: Klara, Inc.
Inspired by: https://github.com/apple-oss-distributions/Libc
Differential Revision: https://reviews.freebsd.org/D50485
|
|
|
|
|
|
|
| |
Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D50483
|
|
|
|
|
|
|
| |
Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D50483
|
|
|
|
|
|
|
| |
Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D50483
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
_libc_get_static_tls_base() is just _tcb_get() followed by adding (for
Variant I) or subtracting (for Variant II) the offset, so just inline
that as the implementation (like we do in rtld-elf) rather than having
another copy (or equivalent) of _tcb_get()'s assembly.
_get_static_tls_base() doesn't even have any MD assembly as it's
reading thr->tcb, the only difference is whether to add or subtract, so
again just inline that.
Whilst here add some missing blank lines to comply with style(9) for
elf_utils.c's includes, and use a pointer type rather than uintptr_t to
reduce the need to cast, as is done in rtld-elf.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D50592
|
|
|
|
|
|
| |
This change was unreviewed and should not have been committed to :main.
This reverts commit 9b37d84c87e69dabc69d818aa4d2fea718bd8b74.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These tests were recently enabled on main and have failed consistently
since they were enabled.
- lib.libc.net.getaddrinfo.getaddrinfo.basic
- lib.libc.net.getaddrinfo.getaddrinfo.nofamily
- lib.libc.net.getaddrinfo.getaddrinfo_test.basic
- lib.libc.net.getaddrinfo.getaddrinfo_test.empty_servname
- lib.libc.net.getaddrinfo.getaddrinfo_test.sock_raw
Mark them as expected failures so they no longer count as failures in
Jenkins CI.
PR: 285826
MFC with: 5313457780, 0b773a94ab
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The offset here is relative to the TCB, not whatever the thread pointer
points to, so as with powerpc and powerpc64 we need to account for that.
However, rather than using hard-coded offsets as they did, due to
predating machine/tls.h, we can just re-use _tcb_get().
Note that if libthr is used, and its initialiser has been called, it
will take a different path that uses _get_static_tls_base, which works
just fine on riscv (adding the offset to thr->tcb). This only affects
programs that aren't linked against libthr (or that are but manage to
dlopen before the initialiser is called, if that's even possible).
In future this code should be made MI by just reusing _tcb_get() and
checking the TLS variant (since the offset here is positive even for
variant II, where it should be subtracted), but this is a targeted fix
that makes it clear what's changing.
Reviewed by: kib
Fixes: 5d00c5a6571c ("Fix initial exec TLS mode for dynamically loaded shared objects.")
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D50564
|
|
|
|
|
|
|
| |
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D50509
|
|
|
|
|
|
|
|
| |
This daemon has been removed; also remove things which reference it.
Reviewed by: manu, des, emaste
Approved by: des (mentor)
Differential Revision: https://reviews.freebsd.org/D50441
|