Commit Graph

281655 Commits

Author SHA1 Message Date
Michael Paepcke
9b70ce712c UPDATING
Add notice to kernel options KBD_DELAY1 and KBD_DELAY2

Reviewed by: imp (tweaked whitespace too)
Pull Request: https://github.com/freebsd/freebsd-src/pull/649
2023-02-24 23:20:52 -07:00
Michael Paepcke
8d966fb02e sys/conf/NOTES add new KBD_DELAY kernel options
add section for new kernel keyboard options

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/649
2023-02-24 23:20:52 -07:00
Michael Paepcke
1469c6331f kbd: ukbd.4 and atkbdc.4 add section about new kernel options
add section about  new kernel options KBD_DELAY1 and KBD_DELAY2

Reviewed by: imp (small tweaks to man page)
Pull Request: https://github.com/freebsd/freebsd-src/pull/649
2023-02-24 23:20:34 -07:00
Michael Paepcke
c51978f4b2 kbd: add KBD_DELAY1 and KBD_DELAY2
Allow to configure KBD_DELAY* via KERNCONF for user-land less embedded
and security appliances

Reviewed by: imp (folded)
Pull Request: https://github.com/freebsd/freebsd-src/pull/649
2023-02-24 23:19:05 -07:00
Mark Johnston
49e3972afc lockstat: Use gelf.h instead of playing games with the preprocessor
This reverts a portion of 1477dd823e ("Merge OpenZFS support in to
HEAD.").  No functional change intended.

MFC after:	1 week
2023-02-24 20:16:51 -05:00
Mark Johnston
f4f5e69c84 lockstat: Use the correct type for a symbol size
No functional change intended.

MFC after:	1 week
2023-02-24 20:11:08 -05:00
Piotr Kubaj
6ae90f5985 gh-bc: don't disable LTO on powerpc64
Summary:
The LTO issue has been fixed. While -flto for some reason is commented out,
since it wasn't completely removed, it may be expected to be reenabled.

Reviewers: se
Approved by: se
MFC after: 3 days
Subscribers: imp
Differential Revision: https://reviews.freebsd.org/D38755
2023-02-25 00:49:27 +01:00
Stefan Eßer
77606d5a8c usr.bin/gh-bc: clean-up Makefile
Remove commented out debug options and re-enable LTO for most
architectures.
2023-02-25 00:07:25 +01:00
Stefan Eßer
103d7cdfb7 vendor/bc: import version 6.3.1
This version adds a command to dc to query whether extended registers
are enabled or not.

(cherry picked from commit 61e1a12bb6c3bfdb0a4e499c88e8eaa2b548e427)
2023-02-24 23:52:09 +01:00
John-Mark Gurney
eb81dd8404
make cross build from arm64 work..
Reviewed by:	dim, imp, emaste
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D38762
2023-02-24 14:24:19 -08:00
Joseph Koshy
163dd260e3
Add gnn@ as my mentor.
Approved by:	gnn (mentor)
Differential Revision: https://reviews.freebsd.org/D38673
2023-02-24 21:42:30 +00:00
Mateusz Guzik
1ebec3806e vfs: s/ppsratecheck/eventratecheck
nfc
2023-02-24 19:30:49 +00:00
Mateusz Guzik
83158c6893 time: s/ppsratecheck/eventratecheck
The routine is used as a general event-limiting routine in places which
have nothing to do with packets.

Provide a define to keep everything happy.

Reviewed by:	rew
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D38746
2023-02-24 19:26:36 +00:00
Kyle Evans
b9c8f4900c config: drop reference to removed System_spec
Fixes the following warning:

yacc: w - the symbol System_spec is undefined
yacc: 3 rules never reduced

Reported by:	otis
Fixes:	6a836ea741 ("config(8): Remove obsolete 'config' directive.")
2023-02-24 13:16:19 -06:00
Mark Johnston
19a7cf0ce8 scmi: Suppress a couple of -Wunused-function warnings
No functional change intended.

Sponsored by:	Klara, Inc.
2023-02-24 13:44:52 -05:00
Paul Floyd
2c709ee70a libc: handle zero alignment in memalign()
For compatibility with glibc. The previous code would trigger a division
by zero in roundup() and terminate.  Instead, just pass through to
malloc() for align == 0.

PR:		269688
Reviewed by:	imp, mjg
MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/655
2023-02-24 13:19:06 -05:00
Mitchell Horne
07ccf71451 bcm_dma: don't dereference NULL softc
This file defines a small API to be used by other drivers. If any of
these functions are called before the bcm_dma device has attached we
should handle the error gracefully. Fix a formatting quirk while here.

Reviewed by:	manu
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D38756
2023-02-24 13:20:40 -04:00
Mark Millard
9873b17169 bcm_dma: attach at an earlier bus pass
The sdhci_bcm driver attach routine relies on bcm_dma already being
attached, in order to allocate a DMA channel. However, both drivers
attached at the default pass so this is not guaranteed. Newer RPI
firmware exposes this assumption, and the result is a NULL-dereference
in bcm_dma_allocate().

To fix this, use BUS_PASS_SUPPORTDEV for bcm_dma.

PR:		268835
Reviewed by:	mhorne
MFC after:	1 week
2023-02-24 13:20:40 -04:00
Rick Macklem
4036fcb805 nfsd: Fix a use after free when vnet prisons are deleted
The Kasan tests show the nfsrvd_cleancache() results
in a modify after free. I think this occurs because the
nfsrv_cleanup() function gets executed after nfs_cleanup()
which free's the nfsstatsv1_p.

This patch makes them use the same subsystem and sets
SI_ORDER_FIRST for nfs_cleanup(), so that it will be called
after nfsrv_cleanup() via VNET_SYSUNINIT().

The patch also sets nfsstatsv1_p NULL after free'ng it,
so that a crash will result if it is used after free'ng.

Tested by:	markj
Reviewed by:	markj
MFC after:	3 months
Differential Revision:	https://reviews.freebsd.org/D38750
2023-02-24 07:36:28 -08:00
Cy Schubert
70960bb86a ping: Fix unsigned integer underflow resuling in a ping -R segfault
ping -R (F_RROUTE) will loop at ping.c:1381 until it segfaults or
the unsigned int hlen happens to be less than the size of an IP header:

slippy$ ping -R 192.168.0.101
PING 192.168.0.101 (192.168.0.101): 56 data bytes
64 bytes from 192.168.0.101: icmp_seq=0 ttl=63 time=1.081 ms
RR: 	192.168.0.1
	192.168.0.101
	192.168.0.101
	10.1.1.254
	10.1.1.91
unknown option bb
unknown option 32
unknown option 6
...
unknown option 96
unknown option 2d
Segmentation fault

The reason for this is while looping through loose source routing (LSRR)
and strict source routing (SSRR), hlen will become smaller than the IP
header. It may even become negative. This should terminate the loop.
However, when hlen is unsigned, an integer underflow occurs becoming a
large number causing the loop to continue virtually forever until hlen
is either by chance smaller than the lenghth of an IP header or it
segfaults.

Reviewed by:	asomers
Fixes:		46d7b45a26
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D38744
2023-02-24 06:50:53 -08:00
Mike Karels
ae4387d724 riscv kernel config: clean up whitespace
Most options in kernel config files use "options<space><tab>OPTION".
This allows the option to be commented out without shifting columns.
A few options had two tabs, and some had spaces.  Make them consistent.
2023-02-24 08:36:29 -06:00
Mike Karels
8995b96f34 powerpc kernel config: clean up whitespace
Most options in kernel config files use "options<space><tab>OPTION".
This allows the option to be commented out without shifting columns.
A few options had two tabs, and some had spaces.  Make them consistent.
2023-02-24 08:36:29 -06:00
Mike Karels
d44acf5d8d i386 kernel config: clean up whitespace
Most options in kernel config files use "options<space><tab>OPTION".
This allows the option to be commented out without shifting columns.
A few options had two tabs, and some had spaces.  Make them consistent.
2023-02-24 08:36:29 -06:00
Mike Karels
f12907d01a arm64 kernel config: clean up whitespace
Most options in kernel config files use "options<space><tab>OPTION".
This allows the option to be commented out without shifting columns.
A few options had two tabs, and some had spaces.  Make them consistent.
2023-02-24 08:36:29 -06:00
Mike Karels
91646fe575 arm kernel config: clean up whitespace
Most options in kernel config files use "options<space><tab>OPTION".
This allows the option to be commented out without shifting columns.
A few options had two tabs, and some had spaces.  Make them consistent.
2023-02-24 08:36:28 -06:00
Mike Karels
dd6f6030cc amd64 kernel config: clean up whitespace
Most options in kernel config files use "options<space><tab>OPTION".
This allows the option to be commented out without shifting columns.
A few options had two tabs, and some had spaces.  Make them consistent.
2023-02-24 08:36:28 -06:00
Dimitry Andric
df2fbbfa71 Update leap-seconds to latest leap-seconds.3676924800 (expires 2023-12-28)
Obtained from:	ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.3676924800
MFC after:	3 days
2023-02-24 13:18:05 +01:00
Alexander V. Chernikov
efeb800311 netlink: fix NOINET6 build.
Reported by:	Michael Paepcke <bugs.fbsd@paepcke.de>
PR:		269787
MFC after:	3 days
2023-02-24 10:21:06 +00:00
Mark Johnston
9d7cc536e2 buf: Make bufspace_daemon_shutdown() a no-op after a panic
This function doesn't need to do anything in that context, and calling
wakeup() can lead to recursive panics.

Discussed with:	mhorne
MFC after:	1 week
2023-02-23 21:56:36 -05:00
Mark Johnston
8c8574acb8 config: Include errno.h in mkmakefile.cc
Commit da88842029 ("config: error out on malformed env/hint lines")
added a reference to EINVAL.  In some configurations the bootstrap tools
build fails for lack of errno definitions.

Fixes:	da88842029 ("config: error out on malformed env/hint lines")
Reported by:	syzbot+b1a5d112a737d9a2be9b@syzkaller.appspotmail.com
2023-02-23 21:53:06 -05:00
Kyle Evans
4e696aff69 iconvlist(3): fix count argument type
count is just an unsigned int, not a pointer.

Sponsored by:	Klara, Inc.
2023-02-23 15:22:12 -06:00
Mina Galić
0455b90bee tools/git: fix typos in documentation
and change mention of svn to git.

Reviewed by:	emaste
Pull Request:	https://github.com/freebsd/freebsd-src/pull/659
2023-02-23 16:15:19 -05:00
Bjoern A. Zeeb
c9ba91435a net80211: ieee80211_swscan_bg_scan() track return variable under lock
As the comment says it probably does not matter but use a local
variable to track state under lock so we can return the last known
good state of what we thought we were operating under after unlocking.

Likely no functional changes.

Sponsored by:	The FreeBSD Foundation
MFC atfer:	3 days
Reviewed by:	enweiwu, adrian
Differential Revision: https://reviews.freebsd.org/D38660
2023-02-23 21:12:23 +00:00
Ed Maste
17a5a29003 efibootmgr: add missing break for 'u' case
Reviewed by:	imp, zlei
Reported by:	Coverity
CID:		1505695
Fixes:		9a79152994 ("efibootmgr: Add --efidev (-u) to dis...")
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D38747
2023-02-23 14:13:18 -05:00
Zhenlei Huang
7f0ebf0876 Delete obsolete Solaris compat header file stdlib.h
This drops function `getexecname()` redirection.

Historically `getexecname()` is a compatibility definition. Since
openzfs has its own implementation of function `getexecname()` in libspl
and has been merged into base, the compat header file stdlib.h is
no longer needed and should not be used.

Also without this fix libspl will end up an incompatible version of
`getprogname()` with libc. In particular, if zfs is enabled, programs
such as pgrep in /rescue can be wrongly statically linked with libspl
and will not function properly.

PR:		269738
Reviewed by:	markj
Fixes:		9e5787d228 Merge OpenZFS support in to HEAD
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D38733
2023-02-24 02:00:09 +08:00
Alexander V. Chernikov
d2deebe21b netlink: fix addition of blackhole/reject routes.
* Make nhop_set_blackhole() set all necessary properties for the
 nexthop
* Make nexthops blackhole/reject based on the rtm_type netlink
 property instead of using rtflags.

Reported by:	Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
MFC after:	3 days
2023-02-23 17:43:18 +00:00
Kornel Dulęba
98c666cf87 arm: Fix initialization of VFP context
Make sure that pcb_vfpsaved is always initialized.
Create a vfp_new_thread helper that is heavily based on the arm64 logic.
While here remove un unnecessary assigment and add an assertion
to make sure that it's been properly initialized before we return
from a VFP exception.

Reported by: Mark Millard <marklmi@yahoo.com>
Tested by: Mark Millard <marklmi@yahoo.com>
Differential Revision: https://reviews.freebsd.org/D38698
2023-02-23 17:50:26 +01:00
Kornel Dulęba
4d2427f2c4 arm: Unbreak debugging programs that use FP instructions
Contrary to arm64, on armv7 get_vfpcontext/set_vfpcontext can be called
from cpu_ptrace. This can be triggered when gdb hits a breakpoint
in a userspace program.
Relax td == currthread assertion to account for that situation.
While here update an outdated comment in vfp_discard.

Reported by: Mark Millard <marklmi@yahoo.com>
Tested by: Mark Millard <marklmi@yahoo.com>
Differential Revision: https://reviews.freebsd.org/D38696
2023-02-23 17:50:26 +01:00
Mateusz Guzik
f4a9e9fc79 x86: whack kernel gcov vestige
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-02-23 16:42:38 +00:00
Zhenlei Huang
3dd5524264 ctfdump: Use getprogname()
Also remove no longer used function `getpname()`.

Reviewed by:	markj
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D38740
2023-02-24 00:28:35 +08:00
Mateusz Guzik
3a01a97d23 mroute: partially sanitize the file
There is rampant inconsistent formatting all around, make it mostly
style(9)-conformant.

While here:
- drop malloc casts
- rename a rw lock from mroute_mtx to mroute_lock
- replace NOTREACHED comment with __assert_unreachable

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D38652
2023-02-23 13:35:44 +00:00
Konstantin Belousov
15df90218b tmpfs: support the nosymfollow mount option
PR:	269772
Reported by:	firk@cantconnect.ru
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2023-02-23 15:15:17 +02:00
Mina Galić
7e2af4f90b veriexec(4): Fix a compiler error
When building WITH_BEARSSL=1 veriexec(4) failes to compile.
So update the function prototype so that veriexec(4)
compiles again.

Reported by:	gbe
Reviewed by:	mjg, gbe
Approved by:	mjg
Pull Request:	https://github.com/freebsd/freebsd-src/pull/657
2023-02-23 12:14:41 +01:00
Dmitry Chagin
e55e4a6ba3 linux(4): Fixup the interface name translation in netlink
Netlink should translate a FreeBSD interface name to a Linux
interface name.

Reviewed by:		melifaro
Differential Revision:	https://reviews.freebsd.org/D38715
MFC after:		3 days
2023-02-23 11:01:18 +03:00
Dmitry Chagin
3ab3c9c29c linux(4): Consolidate a FreeBSD interface names translation code
We have some amount of interface names translation functions which are
differs by bugs implementation. Consolidates it in a one place.

Fixup loopback interface names translation and use ifnet methods and
accessors, where possible.

Reviewed by:		melifaro
Differential Revision:	https://reviews.freebsd.org/D38714
MFC after:		3 days
X-MFC with:		32fdc75fe7
2023-02-23 11:00:29 +03:00
Dmitry Chagin
200fe6e3a0 linux(4): Use predefined constant instead of hardcoded value
Reviewed by:		melifaro
Differential Revision:	https://reviews.freebsd.org/D38713
MFC after:		3 days
2023-02-23 10:59:34 +03:00
Kristof Provost
57fcf46dee if_ovpn: ovpn_find_peer_by_ip() is unused without INET
Don't define ovpn_find_peer_by_ip() if INET is not set, and do the same
for ovpn_find_peer_by_ip6() and INET6.

Reported by:	mjg
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-02-23 05:56:56 +01:00
Gleb Smirnoff
a170657108 unix/dgram tests: match the kernel behavior
In CURRENT for some time an overflowed unix/dgram socket would
return EAGAIN if it has O_NONBLOCK set.  This proved to be
undesired.  See 71e70c25c0 for details.  Update tests to match
the "new" behavior, which actually is the historical behavior.
2023-02-22 20:44:46 -08:00
Robert Herndon
3ff497061b Fix Coverity issue in the NVDIMM driver
Summary:
Coverity reports a potential memory leak in the nvdimm
driver. Examination shows it's real; fix it.

Sponsored by: Dell Technologies
MFC after: 1w

Test Plan: Changes in use at $WORK

Reviewers: robert.herndon_dell.com, vangyzen, bret_ketchum_dell.com

Subscribers: imp, badger

Differential Revision: https://reviews.freebsd.org/D38676
2023-02-22 20:42:12 -06:00
Michael Tuexen
453aa7fac9 tcp: ensure the tcpcb is not NULL when logging an event
When calling tcp_bblog_pru() on some error paths, tp is NULL,
therefore handle it.

Sponsored by:	Netflix, Inc.
2023-02-23 02:04:17 +01:00