Commit graph

15044 commits

Author SHA1 Message Date
John Baldwin
7252457be7 gcore: Trim stale bits from elf32core.c.
These should have been removed in
d95657a1a7.

Reviewed by:	markj
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D35748

(cherry picked from commit a6c3e5fa39)
2022-08-25 09:31:03 -07:00
Doug Rabson
55f186a13a Move sort to runtime
Allows pkg bootstrap without having to install FreeBSD-utilities

(cherry picked from commit 0c19c4db74)
2022-08-19 14:27:16 +01:00
Xin LI
84d3fc26e3 Deprecate minigzip(1) in preparation of removing it from base system.
Reviewed by:	emaste, pauamma
Differential Revision: https://reviews.freebsd.org/D36000

(cherry picked from commit 0404b8c88f)
2022-08-13 21:01:33 -07:00
Gordon Bergling
a2acdcb602 find.1: Correct the markup
- ASCII is an acronym and there is no ascii(8) manual page
- Reference ascii(7) in the SEE ALSO section

Reported by:	karels
X-MFC with:	321dc6ee7e

(cherry picked from commit 93b8510c36)
2022-08-05 06:59:47 +02:00
Gordon Bergling
e1522ba723 find.1: Fix mandoc warnings and mention a useful manpage
- new sentence, new line
- unknown AT&T UNIX version: At v7
- no blank before trailing delimiter
- reference the ASCII(8) manual page

(cherry picked from commit 321dc6ee7e)
2022-08-05 06:59:18 +02:00
Eugene Grosbein
5725191732 find.1: small language fix after previous change
collate -> collation

(cherry picked from commit d6054ee652)
2022-07-29 09:22:24 +07:00
Eugene Grosbein
519b3b5b54 find.1: explain why "find -s" may differ from "find | sort"
In short, that's because a directory name may end
with a character that goes before slash (/).

MFC after:	1 week

(cherry picked from commit 26a329f49f)
2022-07-29 09:15:10 +07:00
Ed Maste
bf57b55026 vtfontcvt: improve hex font format validation
Previously an EOF would result in sscanf returning -1 leading to a
crash.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-07-26 09:15:01 -04:00
Ed Maste
be707165b8 vtfontcvt: correct usage
Commit e7fd9688ea changed vtfontcvt's command line parsing, but did
not correctly update the usage (it omitted the new -o flag).

Fixes:		e7fd9688ea ("Move font related data structured to...")
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit df777aeb98)
2022-07-26 09:15:01 -04:00
Mateusz Piotrowski
1a07c9d90c backlight(8): Update usage() to match the manual page
MFC after:	1 week

(cherry picked from commit f4b00609ec)
2022-07-26 10:03:30 +02:00
Mateusz Piotrowski
520bae8f1a backlight.8: Show all possible modes in synopsis
MFC after:	1 week

(cherry picked from commit 64a231b90b)
2022-07-26 10:03:29 +02:00
Mateusz Piotrowski
c96be88171 backlight.8: Standardize synopsis and improve examples
MFC after:	1 week

(cherry picked from commit 5c3e424958)
2022-07-26 10:03:28 +02:00
Mateusz Piotrowski
83b8f6f7f0 protect.1: Document that protect(1) does not work in jails
The reason is that in order to protect a process procctl(2) needs
the PRIV_VM_MADV_PROTECT privilege, which is currently denied in jails
(see kern_jail.c).

MFC after:	1 week

(cherry picked from commit 6452fb1e87)
2022-07-22 01:56:29 +02:00
Mateusz Piotrowski
55e8f44d6c protect.1: Improve synopsis
While here, make the list's -width argument a bit shorter for
readability.

MFC after:	3 days

(cherry picked from commit cb56f86025)
2022-07-22 01:56:28 +02:00
Daniel Ebdrup Jensen
69b993767a protect(1): Correct typo and add newline
Fix a typo, and move a sentence onto a new line in accordance with
mdoc(7) syntax.

While here, also remember to bump .Dd accordingly, as it was missed in
the prior commit.

Reported by:	maxim@

(cherry picked from commit bd1eafcdd0)
2022-07-22 01:56:28 +02:00
Adam Wolk
16a44c1242 protect.1: document existence of _oomprotect
Improve discoverability of the functionality by mentioning in the
userland tool manual. Add a SEE ALSO entry to rc.conf(5) where more
details are provided.

Sponsored by:   Fudo Security (a.wolk)
Differential Revision:	https://reviews.freebsd.org/D30334

(cherry picked from commit c8b6be0f7d)
2022-07-22 01:56:27 +02:00
John Baldwin
fd01963cc3 usr.bin/dtc: Include <limits> for std::numeric_limits<>.
This is needed when building natively as a cross-tool on hosts such as
Linux using more recent versions of libstdc++.

Co-authored-by:	Alexander Richardson <arichardson@FreeBSD.org>
Obtained from:	CheriBSD

(cherry picked from commit 1c44d2bf86)
2022-07-13 11:45:51 -07:00
John Baldwin
6ab064ac06 gcore: Use PT_GETREGSET for NT_THRMISC and NT_PTLWPINFO.
This avoids the need for dealing with converting lwpinfo for alternate
ABIs in gcore itself.

Reviewed by:	markj
MFC after:	2 weeks
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D35667

(cherry picked from commit d95657a1a7)
2022-07-13 09:25:02 -07:00
John Baldwin
71b19e1b9c gcore: Remove unused typedefs.
These are no longer needed after commit 4965ac059d which used
PT_GETREGSET to fetch NT_PRSTATUS and NT_FPREGSET.

Reviewed by:	markj, emaste
MFC after:	2 weeks
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D35665

(cherry picked from commit d2a3c30a51)
2022-07-13 09:22:19 -07:00
John Baldwin
4f8a3bb601 gcore: Don't hardcode VM write permissions.
This ensures read-only PT_LOAD segments are not marked as writable in
the phdr flags.

Reviewed by:	markj
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D35398

(cherry picked from commit 81c857dd7e)
2022-07-13 09:18:43 -07:00
John Baldwin
558cb98269 gcore: Remove unused elf_note_arm_vfp function.
Fixes:		add00c381e Use a regset for NT_ARM_VFP.
(cherry picked from commit ad52a7bb03)
2022-07-13 09:18:35 -07:00
Mike Karels
913ebccc8e netstat -i: do not truncate interface names
The field for interface names for netstat -i was 5 characters by
default, which is no longer sufficient with names like "vlan1234"
and "vtnet0".  netstat -iW computed the necessary field width, but
also enlarged the address field by a lot (especially with IPv6 enabled).
Make netstat -i compute the field width for interface names with or
without -W.  Note that the existing default output does not fit in
80 columns in any case.  Update the man page accordingly, documenting
the remaining effect of -W with -i.  Also add -W to the list of
General Options, as there are numerous pointers to this.

Reported by:	Chris Ross
Reviewed by:	melifaro, rgrimes, cy
Differential Revision: https://reviews.freebsd.org/D35703

(cherry picked from commit 231092bb6f)
2022-07-13 08:20:03 -05:00
Warner Losh
82a8b8f0cf lastcomm/sa: Remove sparc64 tests, they aren't needed.
Fix delete-old, since 22375931 MFC, annoy to delete them manually
every make delete-old.

These tests will run only on a sparc64 system, and so never run anymore.

Sponsored by:		Netflix

(cherry picked from commit d6dffbae96)
2022-07-13 14:17:40 +03:00
Dmitry Chagin
5bdeed846d kdump: Decode Linux *at() syscalls
MFC after:		2 weeks

(cherry picked from commit 4d496ab44a)
2022-07-06 14:02:15 +03:00
Dmitry Chagin
b330e63846 kdump: For future use made decode_filemode() public
MFC after:		2 weeks

(cherry picked from commit ed2f123a21)
2022-07-06 14:02:15 +03:00
Dmitry Chagin
29ef2caa02 kdump: Decode Linux clock_nanosleep syscall
MFC after:		2 weeks

(cherry picked from commit 39de84b619)
2022-07-06 14:02:14 +03:00
Dmitry Chagin
4ec7625e66 kdump: Decode Linux sigprocmask how argument
MFC after:		2 weeks

(cherry picked from commit f587a2a765)
2022-07-06 14:02:14 +03:00
Dmitry Chagin
894f26c8f6 kdump: Decode getitimer, setitimer which argument
Reviewed by:		jhb (previous version, without truss)
Differential revision:	https://reviews.freebsd.org/D35231
MFC after:		2 weeks

(cherry picked from commit b9b86b6742)
2022-07-06 14:02:14 +03:00
Dmitry Chagin
2068608ebd kdump: Decode Linux l_sigset_t.
Reviewed by:		markj
Differential revision:	https://reviews.freebsd.org/D35153
MFC after:		2 weeks

(cherry picked from commit 3606a213bf)
2022-07-06 14:02:13 +03:00
Dmitry Chagin
95e89d1019 kdump: Add preliminary support for decoding Linux syscalls
Reviewed by:		jhb
Differential revision:	https://reviews.freebsd.org/D35216
MFC after:		2 weeks

(cherry picked from commit 8a0f6d8cfd)
2022-07-06 14:02:13 +03:00
Dmitry Chagin
b31a7b84b3 kdump: For future use extract common code to a separate files
Reviewed by:		jhb
Differential revision:	https://reviews.freebsd.org/D35356
MFC after:		2 weeks

(cherry picked from commit 8b8e2e8f41)
2022-07-06 14:02:13 +03:00
Mark Johnston
3d81c26f92 truss: Make control message header parsing more robust
print_cmsg() was assuming that the control message chain is well-formed,
but that isn't necessarily the case for sendmsg(2).  In particular, if
cmsg_len is zero, print_cmsg() will loop forever.  Check for truncated
headers and try to recover if possible.

Reviewed by:	tuexen
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 4b0c6fa0dc)
2022-06-29 10:12:33 -04:00
Dmitry Chagin
6e2a3ed6a7 kdump: Decode cpuset_t.
Reviewed by:		jhb
Differential revision:	https://reviews.freebsd.org/D34982
MFC after:		2 weeks

(cherry picked from commit 586ed32106)
2022-06-17 22:35:15 +03:00
Thomas Munro
5fac6f1687 poll(2): Add POLLRDHUP.
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)
2022-06-17 22:22:13 +03:00
Gordon Bergling
402f0bf60d sed(1): Fix a typo in a source code comment
- s/Initialy/Initially/

Obtained from:	NetBSD

(cherry picked from commit bb0e21032b)
2022-06-10 14:26:39 +02:00
Andrew Turner
c74a6c3038 Use getpagesize in gcore to find the page size
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35194

(cherry picked from commit f9ca52bab5)
2022-06-07 15:20:18 +01:00
Dimitry Andric
390adc38fc Merge llvm-project main llvmorg-14-init-17616-g024a1fab5c35
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-17616-g024a1fab5c35.

PR:		261742
MFC after:	2 weeks

(cherry picked from commit 04eeddc0aa)
2022-06-04 13:59:19 +02:00
Dimitry Andric
1f6fd64fe9 Merge llvm-project main llvmorg-14-init-10223-g401b76fdf2b3
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-10223-g401b76fdf2b3.

PR:		261742
MFC after:	2 weeks

(cherry picked from commit 5e801ac66d)
2022-06-04 13:58:59 +02:00
Christian Weisgerber
657219c49d truss: add ppoll(2) argument decoding
PR:		264029
Approved by:	emaste
MFC after:	3 days

(cherry picked from commit 9bf4983f54)
2022-05-20 14:51:40 +02:00
John Baldwin
382ffc8786 x86: Add a NT_X86_SEGBASES register set.
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)
2022-05-13 09:45:19 -07:00
John Baldwin
e0b7d19d44 arm,arm64: Add a NT_ARM_TLS read-only register set.
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)
2022-05-12 17:39:00 -07:00
John Baldwin
d801e93ec2 Use a regset for NT_ARM_VFP.
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)
2022-05-12 17:02:44 -07:00
John Baldwin
6c2ea7f890 gcore: Use PT_GETREGSET to fetch NT_PRSTATUS and NT_FPREGSET.
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)
2022-05-12 15:13:00 -07:00
Alan Somers
f7896015fc ctlstat: add prometheus output
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)
2022-05-12 14:43:01 -06:00
John Baldwin
10e4ad0b1b top: Remove a duplicate extern declaration for show_args.
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)
2022-05-10 15:51:49 -07:00
Piotr Pawel Stefaniak
963fdecd1a uudecode: correct error message
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)
2022-04-30 10:01:22 +02:00
Piotr Pawel Stefaniak
2eef2f0f8f uu{encode,decode}: improve style
(cherry picked from commit d5d3f5dab2)
2022-04-30 09:59:08 +02:00
Gordon Bergling
1a276dbad1 sed(1): Fix a typo in the manual page
- s/occurances/occurrences/

(cherry picked from commit 583bb9c530)
2022-04-23 08:54:44 +02:00
Kyle Evans
6182c78818 diff: tests: loosen up requirements for report_identical
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)
2022-04-21 17:38:00 -05:00
Konstantin Belousov
f9daaf452a Document procstat(1) advlock command
(cherry picked from commit bd8701dede)
2022-04-16 05:18:19 +03:00