Teach poll(2) to support Linux-style POLLRDHUP events for sockets, if
requested. Triggered when the remote peer shuts down writing or closes
its end.
Reviewed by: kib
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D29757
(cherry picked from commit 3aaaa2efde)
This register set contains the values of the fsbase and gsbase
registers. Note that these registers can already be controlled
individually via ptrace(2) via MD operations, so the main reason for
adding this is to include these register values in core dumps. In
particular, this will enable looking up the value of TLS variables
from core dumps in gdb.
The value of NT_X86_SEGBASES was chosen to match the value of
NT_386_TLS on Linux. The notes serve similar purposes, but FreeBSD
will never dump a note equivalent to NT_386_TLS (which dumps a single
segment descriptor rather than a pair of addresses) and picking a
currently-unused value in the NT_X86_* range could result in a future
conflict.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D34650
(cherry picked from commit 931983ee08)
This register set exposes the per-thread TLS register. It matches the
layout used by Linux on arm64. Linux does not implement this note for
32-bit arm.
Reviewed by: andrew, markj
Sponsored by: University of Cambridge, Google, Inc.
Differential Revision: https://reviews.freebsd.org/D34595
(cherry picked from commit b2cb74c22c)
This includes adding support for NT_ARM_VFP for 32-bit binaries
running under aarch64 kernels both for ptrace(), and coredumps via the
kernel and gcore.
Reviewed by: andrew, markj
Sponsored by: University of Cambridge, Google, Inc.
Differential Revision: https://reviews.freebsd.org/D34448
(cherry picked from commit add00c381e)
Add a elf_putregnote() helper to build the ELF note for a register
set. Once nice result of this approach is that this reuses the
kernel's support for generating 32-bit register sets for 32-bit
processes avoiding the need to duplicate that logic in elf32core.c.
Reviewed by: markj
Sponsored by: University of Cambridge, Google, Inc.
Differential Revision: https://reviews.freebsd.org/D34447
(cherry picked from commit 4965ac059d)
When invoked by inetd, ctlstat -P will now produce output suitable for
ingestion into Prometheus.
It's a drop-in replacement for https://github.com/Gandi/ctld_exporter,
except that it doesn't report the number of initiators per target, and
it does report time and dma_time.
Sponsored by: Axcient
Relnotes: yes
Reviewed by: bapt, bcr
Differential Revision: https://reviews.freebsd.org/D29901
(cherry picked from commit 1a7f22d9c2)
This fixes a -Wnested-extern error with GCC 9. There is an existing
extern declaration in top.h.
Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D31937
(cherry picked from commit 4c9cb057bd)
PR: 153276
Reported by: David Brennan
(cherry picked from commit 9f3203c003)
uudecode: add missing test files to Makefile
(cherry picked from commit 1b3af110bc)
uudecode: use SRCDIR in the regression test
(cherry picked from commit f5138631fb)
uudecode: move the new uudecode test from uuencode/ to uudecode/
I don't know how that happened.
(cherry picked from commit ae6aa2d43d)
This test cannot run without an unprivileged_user being specified
anyways, so just run as the unprivileged user. Revoking read permisions
works just as well if you're guaranteed non-root.
Reviewed by: pstef
Sponsored by: Klara, Inc.
(cherry picked from commit efba49ee5a)
If an unqualified name is provided, /dev/backlight/ is automatically
prepended instead of /dev/backlight.
MFC after: 3 days
(cherry picked from commit 2f60a7f902)
If fstat(2) fails the close(2) won't be called, which will leak the
file descriptor.
The idea was borrowed from OpenBSD, where similar patch
was applied for futimens(2).
MFC after: 1 week
(cherry picked from commit cb54c500d0)
In commit 6fa5bf0832 the pr(1) related code in diff was moved around,
but some part of the indentation was messed up, and one line was
duplicated. Remove the duplicated line, and fix up the indentation.
Reviewed by: bapt
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D34398
(cherry picked from commit f7d6e97e4b)
This was meant to read `basic`, rather than a duplicate of `f_flag`. It
is largely irrelevant, though, as atf_test_case mostly just makes
sure that the proper functions are defined.
(cherry picked from commit 0e73b834f3)
This enables thread-aware timers which in turn fixes benchmark result
reports.
Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D34238
(cherry picked from commit 6882d53b7f)
Providing a timestamp with seconds granularity helps make it obvious
that the display is updating.
Reviewed by: mckusick
Differential Revision: https://reviews.freebsd.org/D29181
(cherry picked from commit c9d1fa7003)
There likely should be a macro for the ports that support lto, but I'm
making sure that all the mips things build before decommissioning it and
this is the only thing that's broken...
Sponsored by: Netflix
(cherry picked from commit d677d4be0c)
The current implementation of sysctlbyname() does not support the user
sub-tree. This function exits with a return value of 0, but sets the
passed string buffer to an empty string.
As a result, the whereis program did not use the value of the sysctl
variable "user.cs_path", but only the value of the environment
variable "PATH".
This update makes whereis use the sysctl function with a fixed OID,
which already supports the user sub-tree.
(cherry picked from commit c454c57163)
Use strtoll() to parse the argument of the -S option.
FreeBSD has supported 64 bit file offsets for more than 25 years on
all architectures and off_t is a 64 bit integer type for that reason.
While strtol() returns a 64 bit value on 64 LP64 architectures, it
is limit to 32 bit on e.g. i386. The strtoll() function returns a 64
but result on all supported architectures and therefore supports the
possible file lengths and file offsets on 32 bit archtectures.
(cherry picked from commit 32066c96fa)
The man page states that "-t %+" prints time information in the same
format as date with no format specifier.
This was not the case, the format used was always that of date for the
POSIX locale.
The fix suggested by the reporter leads to output that matches the
documentation.
(cherry picked from commit 20f8331aca)
The C++-style comment marker "//" has been added with the rewrite of
the preprocessor features. Since this character sequence occurs in
ULRS, the reminder of the URL was considered a comment and stripped
from the calendar line.
Change parsing of "//" to only start a comment at the begin of a line
or when preceeded by a white-space character.
(cherry picked from commit 35b8fd0b69)
The result of fstat() was not checked. Furthermore, there was a
redundant check of st.st_size. Fix both.
Reported by: Coverity
MFC after: 1 week
Sponsored by: Dell EMC Isilon
(cherry picked from commit 58135fbd8b)
elfdump -E on an empty file would complain "Invalid argument" because
it tried to mmap zero bytes. With the -E flag, elfdump should
simply exit non-zero. For tiny files, the code would reference off
the end of the mapped region.
Ensure the file is large enough to contain an ELF header before mapping it.
MFC after: 1 week
Sponsored by: Dell EMC Isilon
(cherry picked from commit 86e5e10daf)
This could be done better by making each test a separate ATF test case.
This exercise is left for the reader.
Reviewed by: delphij (earlier version)
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D34303
(cherry picked from commit 1581ec9a45)
Let "fetch -a" resume truncated transfer automatically to perform
another attempt if it obtained some new data in previous one
making progress.
Do not consider HTTP 5XX errors as soft failures.
Also, authorization errors should not be considered as soft failures.
(cherry picked from commit e3bad5f7aa)
(cherry picked from commit a4efbe0d6d)
(cherry picked from commit bf599c03f0)
(cherry picked from commit 08a2504a20)
(cherry picked from commit 85f15576b4)
Libarchive 3.6.0
New features:
PR #1614: tar: new option "--no-read-sparse"
PR #1503: RAR reader: filter support
PR #1585: RAR5 reader: self-extracting archive support
New features (not used in FreeBSD base):
PR #1567: tar: threads support for zstd (#1567)
PR #1518: ZIP reader: zstd decompression support
Security Fixes:
PR #1491, #1492, #1493, CVE-2021-36976:
fix invalid memory access and out of bounds read in RAR5 reader
PR #1566, #1618, CVE-2021-31566:
extended fix for following symlinks when processing the fixup list
Other notable bugfixes and improvements:
PR #1620: tar: respect "--ignore-zeros" in c, r and u modes
PR #1625: reduced size of application binaries
Relnotes: yes
(cherry picked from commit 833a452e9f)
The inp_gencnt will be used to identify a TCP endpoint by an upcoming
command line tool to set TCP socket options.
Reviewed by: rscheff
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D34137
(cherry picked from commit 5f64777a4f)