1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-18 02:19:39 +00:00
Commit Graph

278023 Commits

Author SHA1 Message Date
Zhenlei Huang
5863982b3d init_main: Sprinkle const qualifiers where appropriate
No functional change intended.

MFC after:	1 week

(cherry picked from commit 7412517f29)
(cherry picked from commit b6728c3f0b)
2024-09-02 13:03:41 +08:00
Franco Fichtner
feb14552cc u3g: add SIERRA AC340U
Pull request:	https://github.com/freebsd/freebsd-src/pull/1397

(cherry picked from commit 4b6e76eff8)
2024-09-01 21:46:43 -07:00
Vincenzo Maffione
574f00950d libnetmap: remove interface name validation
When trying to use a VLAN device (e.g. "em0.123") with a dot
the library fails to parse the interface correctly. The former
pattern is much too restrictive given that almost all characters
can be coerced into a device name via ifconfig.

Remove the particularly restrictive validation.  Some characters
still cannot be used as an interface name as they are used as
delimiters in the syntax, but this allows to be able to use most
of them without an issue.

Submitted by:	franco@opnsense.org
Differential Revision:	https://reviews.freebsd.org/D42485
Reviewed by:	vmaffione

(cherry picked from commit ad874544d9)
2024-09-01 17:54:48 +00:00
Simon J. Gerraty
2d203f534b bmake/unit-tests/Makefile use _shell
Set _shell like later versions of bmake so that .SHELL
does not appear in conditionals.

This avoids errors when an older version of bmake parses this makefile
such as when doing src upgrade from stable/12 or older.

Direct commit to stable/13 since this is the only branch where
this issue arrises.

PR:		281151
2024-08-31 23:29:19 -07:00
Gordon Tetlow
b8abafb4de
release: Redirect etcupdate logfile to /dev/null.
Stop shipping a log file for etcupdate. This is a source of
non-reproducability as it uses mktemp thereby guaranteeing the output is
different each run.

Differential Revision:	https://reviews.freebsd.org/D46317

(cherry picked from commit e972e408d1)
2024-08-31 09:18:49 -07:00
Rick Macklem
6bde10b638 nfsproto.h: Define the new mode_umask attribute
RFC8275 defines a new attribute as an extension to NFSv4.2
called MODE_UMASK.  This patch adds the attribute number
to nfsproto.h.

Future patches will add optional support for the attribute.
This patch does not cause any semantics change.

(cherry picked from commit 10d5b43424)
2024-08-30 19:02:57 -07:00
Michael Tuexen
a1b4e57317 tcp: fix format of sysctl variable
The format for CTLTYPE_UINT is "IU" instead of "UI" as specified
in sysctl.9.

Reviewed by:		cc, zlei
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D46408

(cherry picked from commit 498286d4e8)
2024-08-30 08:47:03 +02:00
Michael Tuexen
0e6dbb6732 sctp: fix format of sysctl variables
(cherry picked from commit a1d9ce19b1)
2024-08-30 08:46:24 +02:00
Michael Tuexen
c467031b61 tcp: improve consistency of SYN-cache handling
Originally, a SYN-cache entry was always allocated and later freed,
when not needed anymore. Then the allocation was avoided, when no
SYN-cache entry was needed, and a copy on the stack was used.
But the logic regarding freeing was not updated.
This patch doesn't re-check conditions (which may have changed) when
deciding to insert or free the entry, but uses the result of
the earlier check.
This simplifies the code and improves also consistency.

Reviewed by:		glebius
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D46410

(cherry picked from commit e41364711c)
2024-08-30 08:45:44 +02:00
Michael Tuexen
5420e4f563 tcp: initialize the LRO hash table with correct size
There will at most lro_entries entries in the LRO hash table. So no
need to take lro_mbufs into account, which only results in the
LRO hash table being too large and therefore wasting memory.

Reviewed by:		rrs
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D46378

(cherry picked from commit aa6c490bf8)
2024-08-30 08:44:35 +02:00
Warner Losh
e95ffda78a loader.efi(8): beef up the updating the ESP
There's a huge variety of situations when booting with UEFI. Document
more of them, hopefully better.

Feedback from: jrtc27
MFC After: 3 days
Sponsored by:		Netflix

(cherry picked from commit 871911a4ab)
2024-08-29 12:14:09 -06:00
Kristof Provost
6b3bfb16e5 pf: cope with SCTP port re-use
Some SCTP implementations will abort connections and then later re-use the same
port numbers (i.e. both src and dst) for a new connection, before pf has fully
purged the old connection.

Apply the same hack we already have for similarly misbehaving TCP
implementations and forcibly remove the old state so we can create a new one.

MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 82e021443a)
2024-08-27 14:17:59 +02:00
Ed Maste
51768dc31d ctl: avoid heap info leak in ctl_request_sense
Previously 3 bytes of data from the heap could be leaked to ctl
consumers.

Reported by:	Synacktiv
Reviewed by:	asomers, mav
Sponsored by:	The Alpha-Omega Project
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46091

(cherry picked from commit db87c98168)
(cherry picked from commit 131b7dcb2f)
2024-08-26 09:28:17 -04:00
Ed Maste
6a847b6d1e linux.4: clarify path translation
Try to be a little more explicit about the path translation mechanism
accessing /compat/linux/<path> then falling back to /<path>.

As suggested by martin@lispworks.com, refer to the compat path
explicitly, and correct an existing grammaro.

PR:		277804
Reviewed by:	fernape
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit f66e71fa78)
(cherry picked from commit d1daec3d35)
(cherry picked from commit 226c733737)
2024-08-26 09:22:58 -04:00
Oliver Fromme
cb8f15aeed amdsmn(4), amdtemp(4): add support for AMD Ryzen 7 "Phoenix" processors
Adds support for AMD Ryzen 7 "Phoenix" processors (family 0x19,
model 0x70-0x7f) to the amdsmn(4) and amdtemp(4) drivers. This
enables temperature readings of these CPUs via sysctl.

The sensors function identically to those for the "Raphael" processors
(model 0x60-0x6f); only the PCI device ID differs.

PR:		kern/280942
Relnotes:	yes
MFC after:	3 days

(cherry picked from commit ef3f8aa0a0)
2024-08-25 22:17:17 -07:00
Eugene Grosbein
f20a1805f7 libalias: fix subtle racy problem in outside-inside forwarding
sys/netinet/libalias/alias_db.c has internal static function UseLink()
that passes a link to CleanupLink() to verify if the link has expired.
If so, UseLink() may return NULL.

_FindLinkIn()'s usage of UseLink() is not quite correct.

Assume there is "redirect_port udp" configured to forward incoming
traffic for specific port to some internal address.
Such a rule creates partially specified permanent link.

After first such incoming packet libalias creates new fully specified
temporary LINK_UDP with default timeout of 60 seconds.
Also, in case of low traffic libalias may assign "timestamp"
for this new temporary link way in the past because
LibAliasTime is updated seldom and can keep old value
for tens of seconds, and it will be used for the temporary link.

It may happen that next incoming packet for redirected port
passed to _FindLinkIn() results in a call to UseLink()
that returns NULL due to detected expiration.
Immediate return of NULL results in broken translation:
either a packet is dropped (deny_incoming mode) or delivered to
original destination address instead of internal one.

Fix it with additional check for NULL to proceed with a search
for original partially specified link. In case of UDP,
it also recreates temporary fully specified link
with a call to ReLink().

Practical examples are "redirect_port udp" rules for unidirectional
SYSLOG protocol (port 514) or some low volume VPN encapsulated in UDP.

Thanks to Peter Much for initial analysis and first version of a patch.

Reported by:	Peter Much <pmc@citylink.dinoex.sub.org>
PR:		269770

(cherry picked from commit 8132e95909)
(cherry picked from commit e5b8538083)
2024-08-25 13:42:12 +07:00
Cy Schubert
7217d74d10 unbound: Vendor import 1.21.0
Release notes at
	https://nlnetlabs.nl/news/2024/Aug/15/unbound-1.21.0-released/

Merge commit '96ef46e5cff01648c80c09c4364d10bc6f58119d'

(cherry picked from commit 5685098846)
2024-08-23 12:30:49 -07:00
Cy Schubert
14b5a068c5 unbound: Remove backup file
Upstream unbound includes a backup configure file which is distributed
in the upstream tarball. It must be created by their release process and
not deleted prior to packaging the tarball. I've received two emails so
far asking about it. Let's remove it so nobody else asks about it.

(cherry picked from commit 51c8a9c1be)
2024-08-23 12:30:49 -07:00
Colin Percival
a926bf9254 Modernize DVD package set in preparation for 14.1
[MFC note: We're making the same changes for 13.4.]

Remove archivers/unzip (now in base) and emulators/linux_base-c7 (old
and unlikely to be useful without other linux packages being installed),
ports-mgmt/portmaster (now largely obsolete and discouraged in favour
of using pkg and binary packages) and x11-drivers/xf86-video-vmware
(questionably useful).

Replace devel/git with devel/git@lite (sufficient for most purposes),
and adjust the "ensure the ports exist to sanitize the list" code to
ignore the @lite part when checking that /usr/ports/devel/git exists.

Add sysutils/seatd and x11-wm/sway for wayland support.

MFC after:	1 minute
Differential Revision:	https://reviews.freebsd.org/D45278
2024-08-22 14:59:53 -07:00
Graham Perrin
6becc61b94 pkg-stage.sh: add x11/sddm
MFC After: 2 days
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/996
2024-08-22 14:59:53 -07:00
Kristof Provost
b75115dfd4 pf tests: ensure temporary files end up in the atf working directory
Many of the tests create temporary files. pid files, log files, tcpdump
captures, ... We should take care to ensure they're stored in the temporary
working directory Kyua creates rather than in the root directory.

This ensures there are no conflicts between simultaneously running tests, and
also keeps the root directory clean.

MFC after:	1 month
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit b0fcf4d522)
2024-08-22 09:36:06 +02:00
Andre Albsmeier
8dfa4e5b6c tail -F: fix crash
PR:	280910

(cherry picked from commit 308399a179)
2024-08-21 13:34:06 +03:00
Mike Karels
cd13258d26 pw userdel: destroy home dataset if empty
When removing a user's home directory, if the directory is a ZFS
dataset, it cannot be removed.  If the directory has been emptied,
use "zfs destroy" to destroy it.  This complements the automatic
dataset creation in adduser.  Note that datasets within the directory
and snapshots are not handled, as the complete path is not constructed.

While here, add waitpid() calls to rmat() and pw_user_del().

Reviewed by:	des
Differential Revision:	https://reviews.freebsd.org/D45348

(cherry picked from commit d2f1f71ec8)
2024-08-21 12:31:22 +02:00
Dag-Erling Smørgrav
8398c81b7c adduser: Better document ZFS dataset creation.
MFC after:	3 days
PR:		280873
Reviewed by:	bcr
Differential Revision:	https://reviews.freebsd.org/D46316

(cherry picked from commit 9ff2ebd928)
2024-08-21 12:29:26 +02:00
Mike Karels
da384ffbd5 adduser: create dataset only if home is directly within dataset
Currently, if the prefix of the new home directory is a subdirectory
of a ZFS dataset, adduser will create a new dataset up one or more
levels from the intended destination.  "pw useradd" will then create
a normal directory in the desired location, leaving an unused dataset.
Check for this situation when determining whether to create a dataset,
and let pw create the directory.

Reviewed by:	des
Differential Revision:	https://reviews.freebsd.org/D45229
MFC after:	3 days

(cherry picked from commit 0b39b2e2dd)
2024-08-21 12:29:26 +02:00
Kristof Provost
5f3f07397a pf: invert direction for inner icmp state lookups
(e.g. traceroute with icmp)
ok henning, jsing

Also extend the test case to cover this scenario.

PR:		280701
Obtained from:	OpenBSD
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 89f6723288)
2024-08-20 09:25:21 +02:00
Kristof Provost
7024e1066d pf tests: ensure that traceroutes using ICMP work
PR:		280701
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 34063cb714)
2024-08-20 09:21:57 +02:00
Kristof Provost
0d8d4cc3ea pf: fix icmp-in-icmp state lookup
In 534ee17e6 pf state checking for ICMP(v6) was made stricter. This change
failed to correctly set the pf_pdesc for ICMP-in-ICMP lookups, resulting in ICMP
error packets potentially being dropped incorrectly.
Specially, it copied the ICMP header into a separate variable, not into the
pf_pdesc.

Populate the required pf_pdesc fields for the embedded ICMP packet's state lookup.

PR:		280701
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 2da98eef1f)
2024-08-20 09:21:51 +02:00
Colin Percival
bc29564fee EC2: Set dhclient_arpwait="NO"
The DHCP server in EC2 knows exactly which system should be using
which IP address (and in fact EC2 has source IP filtering on by
default) so there's no point ARPing an address before using it.

The preceding commits (changing the ARP wait time from 2 s to 250 ms)
and this one (eliminating the wait entirely in EC2) reduce the time
required for a newly launched FreeBSD/EC2 instance to launch by 2
seconds.

Discussed with:	icattard
MFC after:	10 days
Sponsored by:	Amazon

(cherry picked from commit 54a543d5ea)
2024-08-19 22:01:34 -07:00
Isaac Cilia Attard
47f6b848e0 dhclient: Update rc.conf.5 with dhclient_arpwait
Add new dhclient_arpwait option to rc.conf.5, with information about
what it does, and cases in which it could be disabled.

Sponsored by:	Google LLC (GSoC 2024)
Signed-off-by:	Isaac Cilia Attard <icattard@FreeBSD.org>
MFC after:	10 days
Reviwed by:	cperciva, brooks, Tom Hukins, Alexander Ziaee
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1368

(cherry picked from commit e4482bfde9)
2024-08-19 21:58:36 -07:00
Isaac Cilia Attard
1f0f31f082 dhclient: rc.conf option to disable ARP resolution
Introduce a new rc.conf option to not wait for ARP resolution within
dhclient. This is plausible on many modern networks where it is possible
to trust the DHCP server to know whether an IP address is available.

Sponsored by:	Google LLC (GSoC 2024)
Signed-off-by:	Isaac Cilia Attard <icattard@FreeBSD.org>
MFC after:	10 days
Reviwed by:	cperciva, brooks, Tom Hukins, Alexander Ziaee
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1368

(cherry picked from commit 503adcdf1d)
2024-08-19 21:58:36 -07:00
Isaac Cilia Attard
8adfd40204 dhclient: Update dhclient man page for n flag
Document new n flag for disabling ARP resolution within dhclient.

Sponsored by:	Google LLC (GSoC 2024)
Signed-off-by:	Isaac Cilia Attard <icattard@FreeBSD.org>
MFC after:	10 days
Reviwed by:	cperciva, brooks, Tom Hukins, Alexander Ziaee
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1368

(cherry picked from commit 84fce4b67a)
2024-08-19 21:58:36 -07:00
Isaac Cilia Attard
5f4e11e111 dhclient: Make arp_timeout configurable
Make arp_timeout available to dhclient.c, set the default timeout to 250
ms, and provide a new command-line argument, 'n' for setting the timeout
to 0.

Sponsored by:	Google LLC (GSoC 2024)
Signed-off-by:	Isaac Cilia Attard <icattard@FreeBSD.org>
MFC after:	10 days
Reviwed by:	cperciva, brooks, Tom Hukins, Alexander Ziaee
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1368

(cherry picked from commit b51569ad3c)
2024-08-19 21:58:36 -07:00
Isaac Cilia Attard
d854b4b2aa dhclient: Use clock_gettime() instead of time()
Change the use of time() to clock_gettime() to have millisecond-accurate
rather than second-accurate timeouts.

Sponsored by:	Google LLC (GSoC 2024)
Signed-off-by:	Isaac Cilia Attard <icattard@FreeBSD.org>
MFC after:	10 days
Reviwed by:	cperciva, brooks, Tom Hukins, Alexander Ziaee
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1368

(cherry picked from commit f0a38976b0)
2024-08-19 21:58:35 -07:00
Isaac Cilia Attard
850e821267 dhclient: Timeouts for entering state_selecting
Use the new add_timeout_timespec() API to handle timeouts for
state_selecting within dhclient.c. No functional change intended.

Sponsored by:	Google LLC (GSoC 2024)
Signed-off-by:	Isaac Cilia Attard <icattard@FreeBSD.org>
MFC after:	10 days
Reviwed by:	cperciva, brooks, Tom Hukins, Alexander Ziaee
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1368

(cherry picked from commit 76e0ffd9f8)
2024-08-19 21:58:35 -07:00
Isaac Cilia Attard
ce9a5b4179 dhclient: Switch timeouts from time_t to timespec
Introduce a new function, add_timeout_timespec(), to use timespec
structs to handle timeouts. Make add_timeout() into a wrapper for the
latter function to retain compatibility with the rest of the codebase.
No functional change intended.

Sponsored by:	Google LLC (GSoC 2024)
Signed-off-by:	Isaac Cilia Attard <icattard@FreeBSD.org>
MFC after:	10 days
Reviwed by:	cperciva, brooks, Tom Hukins, Alexander Ziaee
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1368

(cherry picked from commit 16a235f23c)
2024-08-19 21:58:35 -07:00
Stefan Eßer
e8f52a86ee msdosfs: fix cluster limit when mounting FAT-16 file systems
The maximum cluster number was calculated based on the number of data
cluters that fit in the givem partition size and the size of the FAT
area. This limit did not take into account that the highest 10 cluster
numbers are reserved and must not be used for files.

PR:		280347
Reported by:	pho@FreeBSD.org

(cherry picked from commit 45d4e82bf6)
2024-08-15 21:05:50 +02:00
Dimitry Andric
8a4fd438ef Fix EFI loader reproducibility with lld
When the various loaders under stand/efi are built, the resulting
binaries differ over multiple runs, even if WITH_REPRODUCIBLE_BUILD is
used. This is caused by lld multithreading and the custom linker scripts
for the loaders, and affects the following binaries:

* loader_4th.efi
* loader_4th.sym
* loader_4th.sym.full
* loader_lua.efi
* loader_lua.sym
* loader_lua.sym.full
* loader_simp.efi
* loader_simp.sym
* loader_simp.sym.full

Work around this by disabling lld threading for these binaries.

Reviewed by:	emaste
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D46271

(cherry picked from commit f5ce3f4ef5)
2024-08-15 08:33:40 +02:00
Dimitry Andric
4dac78525c Merge commit d2353ae00c3b from llvm git (by Argyrios Kyrtzidis):
[utils/TableGen/X86CompressEVEXTablesEmitter.cpp] Make sure the tablegen output for the `checkPredicate` function is deterministic (#84533)

  The output for the `checkPredicate` function was depending on a
  `std::map` iteration that was non-deterministic from run to run, because
  the keys were pointer values.

  Make a change so that the keys are `StringRef`s so the ordering is
  stable.

This avoids non-determinism in llvm-tblgen output, which could cause
differences in the generated X86GenCompressEVEXTables.inc file. Although
these differences are not influencing the meaning of the generated code,
they still change a few bytes in libllvm. This in turn influences all
the binaries linked with libllvm, such as clang, ld.lld, etc.

Reported by:	cperciva
MFC after:	3 days

(cherry picked from commit 7a8d05ba19)
2024-08-13 11:24:27 +02:00
Dimitry Andric
dd88f2073c Fix enum warnings in ath_hal's ar9300
This fixes a number of clang 19 warnings:

    sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c:709:25: error: comparison of different enumeration types ('HAL_BOOL' and 'HAL_FREQ_BAND') [-Werror,-Wenum-compare]
      709 |         freq_array[i] = FBIN2FREQ(p_freq_bin[i], is_2ghz);
          |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h:148:11: note: expanded from macro 'FBIN2FREQ'
      148 |     (((y) == HAL_FREQ_BAND_2GHZ) ? (2300 + x) : (4800 + 5 * x))
          |       ~~~ ^  ~~~~~~~~~~~~~~~~~~
    sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c:745:25: error: comparison of different enumeration types ('HAL_BOOL' and 'HAL_FREQ_BAND') [-Werror,-Wenum-compare]
      745 |         freq_array[i] = FBIN2FREQ(p_freq_bin[i], is_2ghz);
          |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h:148:11: note: expanded from macro 'FBIN2FREQ'
      148 |     (((y) == HAL_FREQ_BAND_2GHZ) ? (2300 + x) : (4800 + 5 * x))
          |       ~~~ ^  ~~~~~~~~~~~~~~~~~~
    sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c:781:25: error: comparison of different enumeration types ('HAL_BOOL' and 'HAL_FREQ_BAND') [-Werror,-Wenum-compare]
      781 |         freq_array[i] = FBIN2FREQ(p_freq_bin[i], is_2ghz);
          |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h:148:11: note: expanded from macro 'FBIN2FREQ'
      148 |     (((y) == HAL_FREQ_BAND_2GHZ) ? (2300 + x) : (4800 + 5 * x))
          |       ~~~ ^  ~~~~~~~~~~~~~~~~~~

The `FBIN2FREQ()` and `FREQ2FBIN()` macros in `ar9300eep.h` are invoked
in most places around the `ath_hal` code with a (effectively) boolean
second argument, corresponding to "is this 2GHz?". But in the code that
is warned about, the value `HAL_FREQ_BAND_2GHZ` is of a different
non-boolean type, `HAL_FREQ_BAND`.

Update the `FBIN2FREQ()` and `FREQ2FBIN()` macros to interpret the
second argument as boolean value, and rename the macro parameter names
to better describe their meaning.

Reviewed by:	adrian, bz
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D46201

(cherry picked from commit 82246ac5d8)
2024-08-13 11:24:16 +02:00
Gordon Bergling
b5e1678746 ipfilter(4): Fix typos in source code comments
- s/inconsistancy/inconsistency/

(cherry picked from commit c90a206496)
2024-08-12 14:53:34 +02:00
Gordon Bergling
99385e34c8 sctp(4): Fix typos in source code comments
- s/collasped/collapsed/
- s/defininitions/definitions/
- s/optionaly/optionally/

Obtained from:	NetBSD

(cherry picked from commit 58c99e0750)
2024-08-12 14:53:15 +02:00
Gordon Bergling
5f21183f64 axgbe: Fix two typos in source code comments
- s/specfied/specified/

(cherry picked from commit 619c9488a3)
2024-08-12 14:52:58 +02:00
Michael Tuexen
83572ae1f5 tcp: initialize V_ts_offset_secret for all vnets
Initialize V_ts_offset_secret for each vnet, not only for the
default vnet, since it is vnet specific.

Reviewed by:		Peter Lei
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D46246

(cherry picked from commit 9b569353e0)
2024-08-12 07:47:40 +02:00
Pierre Pronchery
8f16d9f7dc acl_copyin: avoid returning uninitialized memory
acl_copyin did not validate the return value of acl_copy_oldacl_into_acl
which could lead to uninitialized acl structure memory reads.

Reported by:    Synacktiv
Reviewed by:	markj, emaste
Sponsored by:   The Alpha-Omega Project
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46125

(cherry picked from commit 6ee6c7b146)
(cherry picked from commit 6bf5c32ad8)
2024-08-11 19:03:43 -04:00
Ed Maste
0fb9da95f7 pipe: keep uio_iovcnt consistent
In pipe_build_write_buffer we increment uio_iov but did not update
uio_iovcnt.  This would not cause an OOB read (thanks to to uio_resid)
but is inconsistent and could be an issue if other code changes are made
in the future.

Reported by:	Synacktiv
Reviewed by:	jhb, markj, brooks
Sponsored by:	The Alpha-Omega Project
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45999

(cherry picked from commit d8ff42e816)
(cherry picked from commit cbbc8d6730)
2024-08-11 19:03:42 -04:00
Ed Maste
f8a439c538 linuxkpi: use canonical tests for is_{zero,broadcast}_ether_addr
They are functionally equivalent, but the updated form mirrors the tests
in sys/net/ethernet.h and avoids confusion.

Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D21037

(cherry picked from commit a1295b2484)
(cherry picked from commit 6fb0634bc4)
2024-08-11 19:03:42 -04:00
Michael Zhilin
d81b0f5e43 usr.sbin/gstat: add microsecond precision for disk latency
This patch makes gstat to show latency in microseconds if actual latency
is less than 1ms. It affects only "ms/r" and "ms/w" columns.

Before patch:
 L(q)  ops/s    r/s   kBps   ms/r    w/s   kBps   ms/w   %busy Name
    0    922      0      0    0.0    922  35809    0.0    2.8| nda0
    0    928      2     34    0.1    926  35809    0.0    3.1| nda1

After patch:
 L(q)  ops/s    r/s   kBps   ms/r    w/s   kBps   ms/w   %busy Name
    0    496      1     31  0.156    495  16020  0.040    1.5| nda0
    0    492      0      0  0.000    492  16020  0.042    1.5| nda1

Reviewed by:	imp
Sponsored by:	Postgres Professional
Differential Revision:	https://reviews.freebsd.org/D41999

(cherry picked from commit d471b4f71d)
2024-08-11 22:31:13 +03:00
Dmitry Morozovsky
c576a4c57d mailer.conf for sendmail: remove duplicate word.
MFC after:	3 days

(cherry picked from commit 2c2916a3ec)
2024-08-11 15:36:30 +03:00
Kyle Evans
3a9010c98b calendar: don't setlogin(2) in the -a user handlers
As of e67975d331 ("Fix 'calendar -a' in several ways."), `calendar -a`
will now fork off a new process for each user and do all of its own
processing in the user's own context.

As a side-effect, calendar(1) started calling setlogin(2) in each of the
forked processes and inadvertently hijacked the login name for the
session it was running under, which was typically not a fresh session
but rather that of whatever cron/periodic run spawned it.  Thus, daily
and security e-mails started coming from completely arbitrary user.

We could create a new session, but it appears that nothing calendar(1)
does really needs the login name to be clobbered; opt to just avoid the
setlogin(2) call entirely rather than incur the overhead of a new
session for each process.

PR:		280418
Reviewed by:	des, olce
Fixes:		e67975d331 ("Fix 'calendar -a' in several ways.")

(cherry picked from commit 6cb8b61efe)
2024-08-08 15:00:40 -05:00