Commit graph

21935 commits

Author SHA1 Message Date
John Baldwin
5762f69640 ktrace.2: Document KTRFAC_STRUCT_ARRAY.
Sponsored by:	DARPA

(cherry picked from commit c9c9057c77)
2022-11-11 10:18:54 -08:00
John Baldwin
9da0029889 qsort_b_test: Only build on clang.
GCC doesn't support -fblocks.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D36809

(cherry picked from commit ab9293239c)
2022-11-11 10:18:54 -08:00
John Baldwin
65e28bfeaa libbegemot: Disable -Wuse-after-free.
The _xrealloc() function prints pointer values for internal assertion
failures and in one case does so after it has freed the pointer.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D36819

(cherry picked from commit 996ee96597)
2022-11-11 10:18:54 -08:00
John Baldwin
61abd47a09 libiconv VIQR: Fix a use after free.
Use TAILQ_FOREACH_SAFE to walk to list of children mnemonics to free
them instead of TAILQ_FOREACH.

Reviewed by:	emaste
Reported by:	GCC 12 -Wuse-after-free
Differential Revision:	https://reviews.freebsd.org/D36821

(cherry picked from commit 8f27c9d14a)
2022-11-11 10:18:54 -08:00
John Baldwin
fb61949706 libedit: Disable -Wuse-after-free for chartype.c.
GCC 12 thinks ct_visual_string can reuse a pointer after it has been
reallocated, but in this case the warning appears false.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D36820

(cherry picked from commit 7973f26ad6)
2022-11-11 10:18:54 -08:00
John Baldwin
7cefb4bc4b libfetch: Use memcpy in place of an odd strncpy.
The length passed to strncpy is the length of the source string, not
the destination buffer.  This triggers a non-fatal warning in GCC 12.
Hoewver, the code is also odd.  It is really just a memcpy of the
string without its nul terminator.  For that use case, memcpy is
clearer.

Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D36824

(cherry picked from commit 611cf39267)
2022-11-11 10:18:54 -08:00
John Baldwin
87bc509f8e pam_unix: Fix mismatch in array bounds for make_salt().
Reviewed by:	imp, emaste
Reported by:	GCC -Warray-parameter
Differential Revision:	https://reviews.freebsd.org/D36759

(cherry picked from commit 5ceec6c105)
2022-11-11 10:18:52 -08:00
John Baldwin
693e8e6475 ldns: Disable -Warray-parameter warnings from GCC 12 on sha2.c.
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D36758

(cherry picked from commit 5d27845e5a)
2022-11-11 10:18:52 -08:00
John Baldwin
35acd8db34 libc rpc: Fix mismatches in prototypes for array bounds.
Various RPC functions used a bare pointer in function prototypes to
describe fixed-length buffer arguments but used a fixed-length array
in the function definition.  The manual page for these functions
describes the parameters as being fixed-length buffers, so update
the prototypes to match the definitions.

Reviewed by:	imp, emaste
Reported by:	GCC -Warray-parameter
Differential Revision:	https://reviews.freebsd.org/D36757

(cherry picked from commit a2e41a585b)
2022-11-11 10:18:52 -08:00
John Baldwin
f5858d5551 arm64 hwpmc: Support restricting counters to user or kernel mode.
Support the "usr" and "os" qualifiers on arm64 events to restrict
event counting to either usermode or the kernel, respectively.  If
neither qualifier is given, events are counted in both.

Reviewed by:	emaste
Sponsored by:	University of Cambridge, Google, Inc.
Differential Revision:	https://reviews.freebsd.org/D34527

(cherry picked from commit 6bb7ba4aa1)
2022-11-10 13:04:56 -08:00
Mark Johnston
f9b1c96e30 getsockopt.2: Clarify the SO_REUSEPORT_LB text a bit
Refer to sockets rather than processes, since one can have multiple
sockets in a load-balancing group within the same process.

MFC after:	1 week
Sponsored by:	Modirum MDPay
Sponsored by:	Klara, Inc.

(cherry picked from commit d0f8e31761)
2022-11-10 12:02:47 -05:00
Mark Johnston
1a310f395f libsysdecode: Match socket option names containing underscores
MFC after:	1 week
Sponsored by:	Modirum MDPay
Sponsored by:	Klara, Inc.

(cherry picked from commit 34c8598eb1)
2022-11-10 12:02:38 -05:00
Jose Luis Duran
85e34c0f67 strfmon: Remove XXX marks
(cherry picked from commit f0a15aafcb)
2022-11-05 02:30:39 +02:00
Jose Luis Duran
bd847e46f1 strfmon_l: Use specified locale for number formatting
(cherry picked from commit 621bf91893)
2022-11-05 02:30:39 +02:00
Jose Luis Duran
dbfea0a6d8 strfmon_test: Add a test for strfmon_l
(cherry picked from commit 29972f06f9)
2022-11-05 02:30:39 +02:00
Jose Luis Duran
15a6febddb strfmon_test: Reserve space for the null terminator
(cherry picked from commit edcee003e5)
2022-11-05 02:30:39 +02:00
Jose Luis Duran
6e3a5a802e strfmon_l(3): Add name to the man page
(cherry picked from commit d96088b3ab)
2022-11-05 02:30:39 +02:00
Jose Luis Duran
b37c1241fe strfmon(3): Fix # explanation
(cherry picked from commit 7cfd67ce96)
2022-11-01 02:44:42 +02:00
Jose Luis Duran
0e3c078aa8 strfmon(3): Remove repeated words
(cherry picked from commit 0efec50e9e)
2022-11-01 02:44:41 +02:00
Jose Luis Duran
81e14c8f16 strfmon: Fix formatting of a second fixed-width value
(cherry picked from commit 34f88528ed)
2022-11-01 02:44:41 +02:00
Jose Luis Duran
babe20c88c strfmon: Fix an edge case when sep_by_space is 2
(cherry picked from commit 750fe3e6a4)
2022-11-01 02:44:41 +02:00
Jose Luis Duran
8e5a213521 strfmon: Fix alignment when enclosed by parentheses
(cherry picked from commit 947efadc3d)
2022-11-01 02:44:41 +02:00
Jose Luis Duran
56462db942 strfmon: Trim the SPACE from international currency symbol
(cherry picked from commit 6da51e19e3)
2022-11-01 02:44:41 +02:00
Jose Luis Duran
da5b1c42c5 strfmon: Avoid an out-of-bounds access
(cherry picked from commit 9e03b903e3)
2022-11-01 02:44:41 +02:00
Jose Luis Duran
96ef02d4a3 strfmon: Fix typos in source code comments
(cherry picked from commit 0afd11d50f)
2022-11-01 02:44:41 +02:00
Jose Luis Duran
f281bc0686 strfmon: Fix typo in constant
(cherry picked from commit d5980dff6b)
2022-11-01 02:44:41 +02:00
Jose Luis Duran
27744c741d strfmon: Code cleanup
(cherry picked from commit f81dfea291)
2022-11-01 02:44:41 +02:00
Jose Luis Duran
712101eb2b strfmon_test: Add some tests
(cherry picked from commit 3f97d37ac5)
2022-11-01 02:44:41 +02:00
Jose Luis Duran
40fbde93a4 strfmon_test: Fix typo and remove extra space
(cherry picked from commit f91301cc79)
2022-11-01 02:44:40 +02:00
Cy Schubert
70c96c4edf unbound: Vendor import 1.17.0
Reapply 643f9a0581. 64d318ea98 was a
mismerge during fake rebase. Let's reapply it.

Changes include: Added ACL per interface, proxy protocol and bug fixes.

Announcement:   https://nlnetlabs.nl/news/2022/Oct/13/unbound-1.17.0-released/

Merge commit '643f9a0581e8aac7eb790ced1164748939829826' into main

(cherry picked from commit 865f46b255)
2022-10-31 16:22:49 -07:00
Mark Johnston
f5e18a7c3c libvmmapi: Provide an interface for limiting rights on the device fd
Currently libvmmapi provides a way to get a list of the allowed ioctls
on the vmm device file, so that bhyve can limit rights on the device
file fd.  The interface is rather strange: it allocates a copy of the
list but returns a const pointer, so the caller has to cast away the
const in order to free it without aggravating the compiler.

As far as I can see, there's no reason to make a copy of the array, but
changing vm_get_ioctls() to not do that would break compatibility.  So
this change just introduces a better interface: move all rights-limiting
logic into libvmmapi.

Any new operations on the fd should be wrapped by libvmmapi, so also
discourage use of vm_get_device_fd().  Currently bhyve uses it only when
limiting rights on the device fd.

No functional change intended.

Reviewed by:	jhb

(cherry picked from commit 3e9b4532d1)
2022-10-31 09:26:49 -04:00
Ashish SHUKLA
c3af4c1ee8
kvm_close(3): Check kd->sparse_map != NULL before munmap
PR:		266113
Reviewed by:	markj

(cherry picked from commit e6901a29bc)
2022-10-26 03:23:24 +00:00
Mark Johnston
6dde65fa74 libc: Make elf_aux_info() return an error if AT_USRSTACK* is undefined
Otherwise we do not fall back to sysctls if the auxv entries are not
defined by the kernel.  Arguably this is not a bug since we do not
support newer libc running on an older kernel, but we can be a bit more
gentle for the benefit of Valgrind or any other software which
synthesizes the auxv for virtualization purposes.

Reported by:	Paul Floyd <paulf2718@gmail.com>
Reviewed by:	brooks, kib

(cherry picked from commit a4ee0edc4a)
2022-10-25 08:45:08 -04:00
Mitchell Horne
ec390e83ab getpagesize(3): cross-reference getpagesizes(3)
MFC after:	3 days

(cherry picked from commit 4a9b1a1463)
2022-10-24 12:53:11 -03:00
Kyle Evans
63d9ad6e46 Revert "Avoid using TARGET_ARCH in llvm.build.mk"
This reverts commit 8534e6be81, and adds
a cautionary note that there are dragons about that should be considered
when changing it.

PR:		267026
Reviewed by:	dim, imp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D36981

(cherry picked from commit ed7910fbac)
2022-10-17 10:38:46 -05:00
Hans Petter Selasky
e4e79af3f9 libusb(3): Implement libusb_interrupt_event_handler() by exposing existing function.
Sponsored by:	NVIDIA Networking

(cherry picked from commit aa87aa5232)
2022-10-12 17:53:22 +02:00
Hans Petter Selasky
16a49ddfe7 qdivrem: Predict division by zero as false.
Division by zero triggers an arithmetic exception and should not be very
common. Predict this.

No functional change intended.

Sponsored by:	NVIDIA Networking

(cherry picked from commit 1024bb2633)
2022-10-12 17:53:21 +02:00
Ed Maste
a8db30cd70 libc: Fix size range check in setvbuf
From enh at google.com via openbsd-tech mailing list via pfg@:

The existing test is wrong for LP64, where size_t has twice as many
relevant bits as int, not just one. (Found by inspection by
rprichard.)

(cherry picked from commit 9515313b26)
2022-10-07 11:23:10 -04:00
Ed Maste
6ac1039d04 ssh: update to OpenSSH v8.9p1
Release notes are available at https://www.openssh.com/txt/release-8.9

Some highlights:

 * ssh(1), sshd(8), ssh-add(1), ssh-agent(1): add a system for
   restricting forwarding and use of keys added to ssh-agent(1)

 * ssh(1), sshd(8): add the sntrup761x25519-sha512@openssh.com hybrid
   ECDH/x25519 + Streamlined NTRU Prime post-quantum KEX to the
   default KEXAlgorithms list (after the ECDH methods but before the
   prime-group DH ones). The next release of OpenSSH is likely to
   make this key exchange the default method.

 * sshd(8), portable OpenSSH only: this release removes in-built
   support for MD5-hashed passwords. If you require these on your
   system then we recommend linking against libxcrypt or similar.

Future deprecation notice
=========================

A near-future release of OpenSSH will switch scp(1) from using the
legacy scp/rcp protocol to using SFTP by default.

Legacy scp/rcp performs wildcard expansion of remote filenames (e.g.
"scp host:* .") through the remote shell. This has the side effect of
requiring double quoting of shell meta-characters in file names
included on scp(1) command-lines, otherwise they could be interpreted
as shell commands on the remote side.

MFC after:	1 month
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 1323ec5712)
(cherry picked from commit 58def461e2)
2022-10-06 21:39:00 -04:00
Xin LI
39be4f7d1f scandir(3): Rename alphasort_thunk to scandir_thunk_cmp to
reflect that it is not alphasort-specific.

Reported by:	emaste
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D36708

(cherry picked from commit 45ff071ddc)
2022-10-04 23:16:11 -07:00
Konstantin Belousov
f52dbee828 libthr: extract code to get main stack base and size into helpers
(cherry picked from commit e03c7f5005)
2022-09-30 03:29:10 +03:00
Konstantin Belousov
b904f197ce libc, libthr: use AT_USRSTACK{BASE,LIM} instead of sysctl("kern.usrstack") and get_rlimit(RLIMIT_STACK)
(cherry picked from commit e2879ece43)
2022-09-30 03:29:10 +03:00
Konstantin Belousov
a26c4766b0 libthr: use nitems() for mib length
(cherry picked from commit ebf7a01594)
2022-09-30 03:29:10 +03:00
Konstantin Belousov
2b2bf73326 auxv.3: Document AT_USRSTACKBASE and AT_USRSTACKLIM
(cherry picked from commit 62b4fb22df)
2022-09-30 03:29:09 +03:00
Konstantin Belousov
c71b8367de _elf_aux_info(3): add support for AT_USRSTACK{BASE,LIM}
(cherry picked from commit 8f2668b060)
2022-09-30 03:29:09 +03:00
Xin LI
dc9893d194 file: upgrade to 5.43.
(cherry picked from commit a2dfb7224e)
2022-09-27 22:21:30 -07:00
Gordon Bergling
13798b4078 Update SEE ALSO sections for resolver.{3,5} and hosts.5
The mentioned document "Name Server Operations Guide for BIND" is
outdated, so remove it from the SEE ALSO section of hosts.5
and resolver.{3,5}.

PR:		266360
Reported by:	Graham Perrin <grahamperrin at FreeBSD dot org>
Reviewed by:	karels
Differential Revision:	https://reviews.freebsd.org/D36557

(cherry picked from commit 0090d18235)
2022-09-24 10:31:13 +02:00
Fernando Apesteguía
b7c55aaa6d Bump .Dd for recently modified manual pages
During the removal of named(8) references, some pages were modified but their
.Dd where not updated accordingly.

Reported by:	lwhsu@
Fixes:	942e234d86

(cherry picked from commit 4a3c598f35)
2022-09-24 10:25:07 +02:00
Fernando Apesteguía
a3c3c02244 getnetent(3): Add missing reentrant functions
Add documentation for gethostbyname_r, gethostbyname2_r and gethostbyaddr_r

Create proper MLINKs for the new functions.

PR:	249154
Reported by:	asomers@
Approved by:	manpages (0mp@), Pau Amma
Differential Revision: 	https://reviews.freebsd.org/D30469

(cherry picked from commit dc68997328)
2022-09-24 10:12:08 +02:00
Fernando Apesteguía
36c7fd643b Remove references to named(8)
named(8) hasn't been in base for some time. Remove all references to it in
manual pages.

Approved by:	manpages (Pau Amma)
Differential Revision:	https://reviews.freebsd.org/D35586

(cherry picked from commit 942e234d86)
2022-09-24 10:09:35 +02:00