Commit Graph

276195 Commits

Author SHA1 Message Date
Dmitry Chagin
b9b86b6742 kdump: Decode getitimer, setitimer which argument
Reviewed by:		jhb (previous version, without truss)
Differential revision:	https://reviews.freebsd.org/D35231
MFC after:		2 weeks
2022-06-22 14:19:31 +03:00
Dmitry Chagin
2fc3a51db1 libsysdecode: Decode setitimer, getitimer which argument
Reviewed by:		jhb
Differential revision:	https://reviews.freebsd.org/D35230
MFC after:		2 weeks
2022-06-22 14:17:10 +03:00
Dmitry Chagin
3606a213bf kdump: Decode Linux l_sigset_t.
Reviewed by:		markj
Differential revision:	https://reviews.freebsd.org/D35153
MFC after:		2 weeks
2022-06-22 14:15:20 +03:00
Dmitry Chagin
9310737333 linux(4): Trace Linux l_sigset_t.
MFC after:		2 weeks
2022-06-22 14:09:54 +03:00
Dmitry Chagin
8a0f6d8cfd kdump: Add preliminary support for decoding Linux syscalls
Reviewed by:		jhb
Differential revision:	https://reviews.freebsd.org/D35216
MFC after:		2 weeks
2022-06-22 14:03:56 +03:00
Dmitry Chagin
8b8e2e8f41 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
2022-06-22 14:01:36 +03:00
Dmitry Chagin
f85848fc61 libsysdecode: Add method for decoding Linux signal names
Reviewed by:		jhb
Differential revision:	https://reviews.freebsd.org/D35215
MFC after:		2 weeks
2022-06-22 14:00:05 +03:00
Dmitry Chagin
b69ae1a34c libsysdecode: Add preliminary support for decoding Linux syscalls
Differential revision:	https://reviews.freebsd.org/D35354
MFC after:		2 weeks
2022-06-22 13:58:53 +03:00
Dmitry Chagin
9dac609629 libsysdecode: For future use extract common code to a separate files
Reviewed by:		jhb, emaste
Differential revision:	https://reviews.freebsd.org/D35353
MFC after:		2 weeks
2022-06-22 13:12:21 +03:00
Neel Chauhan
4f1d91e413 if_ix: Reset on an ECC error
This mirrors the Linux behavior as seen in the kernel commit d773ce2.

Reviewed by:		kbowling
MFH after:		3 days
Differential Revision:	https://reviews.freebsd.org/D35542
2022-06-21 20:22:25 -07:00
Chuck Silvers
5bd21cbbd1 vfs: fix vfs_bio_clrbuf() for PAGE_SIZE > block size
Calculate the desired page valid mask using math that will not
overflow the types used.

Sponsored by:	Netflix

Reviewed by:	mckusick, kib, markj
Differential Revision:	https://reviews.freebsd.org/D34837
2022-06-21 17:58:52 -07:00
Chuck Silvers
82817f26f8 ffs: fix vn_io_fault_pgmove() offset for PAGE_SIZE > block size
The "offset" argument to vn_io_fault_pgmove() is supposed to be
the offset within the page, but for ffs we currently use the offset
within the block.  When the block size is at least as large as the
page size then these values are the same, but when the page size is
larger than the block size then we need to add the offset of
the block within the page as well.

Sponsored by:	Netflix

Reviewed by:	mckusick, kib, markj
Differential Revision:	https://reviews.freebsd.org/D34835
2022-06-21 17:54:18 -07:00
Ed Maste
a4d55999dc Remove ISA sound cards from NOTES
Fixes:		df51e63eb5 ("Retire snd_ad1816 ISA sound card driver")
Fixes:		aa83e9b189 ("Retire snd_ess ISA sound card driver")
Fixes:		754decef38 ("Retire snd_gusc ISA sound card driver")
Fixes:		5126e5eeeb ("Retire snd_mss ISA sound card driver")
Fixes:		716924cb48 ("Retire snd_sbc ISA sound card driver")

Sponsored by:	The FreeBSD Foundation
2022-06-21 16:33:00 -04:00
Ed Maste
716924cb48 Retire snd_sbc ISA sound card driver
Along with the snd_sb8 and snd_sb16 drivers.  They supported ISA
Creative Sound Blaster and compatible sound cards.

Note that isa/sb.h is not removed, as it is still used by some PCI
sound card drivers.

ISA sound card drivers are deprecated as discussed on the current[1] and
stable[2] mailing lists.  Deprecation notices were added in e39ec8933b
and MFCd to stable branches.

Driver removals are being committed individually so that specific
drivers can be restored if necessary (either in FreeBSD or by downstream
projects).

[1] https://lists.freebsd.org/archives/freebsd-current/2022-March/001680.html
[2] https://lists.freebsd.org/archives/freebsd-stable/2022-March/000585.html

Reviewed by:	mav
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34671
2022-06-21 14:50:04 -04:00
Ed Maste
5126e5eeeb Retire snd_mss ISA sound card driver
The snd_mss driver supported Microsoft Sound System sound cards.

ISA sound card drivers are deprecated as discussed on the current[1] and
stable[2] mailing lists.  Deprecation notices were added in e39ec8933b
and MFCd to stable branches.

Driver removals are being committed individually so that specific
drivers can be restored if necessary (either in FreeBSD or by downstream
projects).

[1] https://lists.freebsd.org/archives/freebsd-current/2022-March/001680.html
[2] https://lists.freebsd.org/archives/freebsd-stable/2022-March/000585.html

Reviewed by:	mav
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	Thttps://reviews.freebsd.org/D34671
2022-06-21 14:50:04 -04:00
Ed Maste
754decef38 Retire snd_gusc ISA sound card driver
snd_gusc supported the Gravis UltraSound MAX and UltraSound PnP sound
cards.

ISA sound card drivers are deprecated as discussed on the current[1] and
stable[2] mailing lists.  Deprecation notices were added in e39ec8933b
and MFCd to stable branches.

Driver removals are being committed individually so that specific
drivers can be restored if necessary (either in FreeBSD or by downstream
projects).

[1] https://lists.freebsd.org/archives/freebsd-current/2022-March/001680.html
[2] https://lists.freebsd.org/archives/freebsd-stable/2022-March/000585.html

Reviewed by:	mav
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34671
2022-06-21 14:50:04 -04:00
Ed Maste
aa83e9b189 Retire snd_ess ISA sound card driver
snd_ess supported sound cards using the ESS 18xx chipset.

ISA sound card drivers are deprecated as discussed on the current[1] and
stable[2] mailing lists.  Deprecation notices were added in e39ec8933b
and MFCd to stable branches.

Driver removals are being committed individually so that specific
drivers can be restored if necessary (either in FreeBSD or by downstream
projects).

[1] https://lists.freebsd.org/archives/freebsd-current/2022-March/001680.html
[2] https://lists.freebsd.org/archives/freebsd-stable/2022-March/000585.html

Reviewed by:	mav
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34671
2022-06-21 14:50:04 -04:00
Ed Maste
df51e63eb5 Retire snd_ad1816 ISA sound card driver
snd_ad1816 supported ISA sound cards based on the Analog Devices
AD1816A "SoundPort® Controller".

ISA sound card drivers are deprecated as discussed on the current[1] and
stable[2] mailing lists.  Deprecation notices were added in e39ec8933b
and MFCd to stable branches.

Driver removals are being committed individually so that specific
drivers can be restored if necessary (either in FreeBSD or by downstream
projects).

[1] https://lists.freebsd.org/archives/freebsd-current/2022-March/001680.html
[2] https://lists.freebsd.org/archives/freebsd-stable/2022-March/000585.html

Reviewed by:	mav
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34671
2022-06-21 14:50:04 -04:00
Eugene Grosbein
048ce0876f adjkerntz(8): detect extra jailed invokation to keep logs clean
It may happen that "adjkerntz -a" called from jailed root crontab.
In that case it spams logs with a line:

sysctl(set: "machdep.wall_cmos_clock"): Operation not permitted

Be silent in that case.

MFC after:	1 month
2022-06-22 01:32:54 +07:00
Jung-uk Kim
b4bdc8f925 OpenSSL: Regen manual pages for OpenSSL 1.1.1p 2022-06-21 14:22:28 -04:00
Jung-uk Kim
ec4d9b059e OpenSSL: Regen assembly file for OpenSSSL 1.1.1p 2022-06-21 14:20:33 -04:00
Jung-uk Kim
83eaf7ae0a OpenSSL: Merge OpenSSL 1.1.1p
Merge commit '54ae8e38f717f22963c2a87f48af6ecefc6b3e9b'
2022-06-21 13:34:41 -04:00
Greg V
8870cb573f LinuxKPI: add asm/neon.h
This is equivalent to asm/fpu/api.h, but is included by drm on aarch64.

Reviewed by:	bz, imp, hselasky
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D35512
2022-06-21 19:10:43 +02:00
Jung-uk Kim
54ae8e38f7 Import OpenSSL 1.1.1p 2022-06-21 10:36:39 -04:00
Emmanuel Vadot
3cbf6518d6 fb: Add a default getinfo method
fb_getinfo is badly designed as it returns either the
info if the driver have the method or ENXIO via the kobj stuff
if the driver doesn't have it.
Add a default method that returns NULL as the code already checks this
and it avoid changing the interface.
None of the drm drivers supported have this method and it sometimes
fails and panic when loading them (for now only usb-c docks seems to be
affected).

MFC after:	3 days
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-06-21 15:52:49 +02:00
Li-Wen Hsu
b256d2dc0c
Temporarily skip flaky test case: sys.netpfil.common.dummynet.ipfw_queue
PR:		264805
Sponsored by:	The FreeBSD Foundation
2022-06-21 20:00:07 +08:00
Hans Petter Selasky
9fc6a63522 ibcore: Fix a race with disassociate and exit_mmap()
If uverbs_user_mmap_disassociate() is called while the mmap is
concurrently doing exit_mmap then the ordering of the
rdma_user_mmap_entry_put() is not reliable.

The put must be done before uvers_user_mmap_disassociate() returns,
otherwise there can be a use after free on the ucontext, and a left over
entry in the xarray. If the put is not done here then it is done during
rdma_umap_close() later.

Add the missing put to the error exit path.

Linux commit:
39c011a538272589b9eb02ff1228af528522a22c

PR:		264473
MFC after:	3 days
Sponsored by:	NVIDIA Networking
2022-06-21 11:33:27 +02:00
Hans Petter Selasky
55d1833671 ibcore: Fix sysfs registration error flow
The kernel commit cited below restructured ib device management
so that the device kobject is initialized in ib_alloc_device.

As part of the restructuring, the kobject is now initialized in
procedure ib_alloc_device, and is later added to the device hierarchy
in the ib_register_device call stack, in procedure
ib_device_register_sysfs (which calls device_add).

However, in the ib_device_register_sysfs error flow, if an error
occurs following the call to device_add, the cleanup procedure
device_unregister is called. This call results in the device object
being deleted -- which results in various use-after-free crashes.

The correct cleanup call is device_del -- which undoes device_add
without deleting the device object.

The device object will then (correctly) be deleted in the
ib_register_device caller's error cleanup flow, when the caller invokes
ib_dealloc_device.

Linux commit:
b312be3d87e4c80872cbea869e569175c5eb0f9a

PR:		264472
MFC after:	3 days
Sponsored by:	NVIDIA Networking
2022-06-21 11:33:27 +02:00
Peter Holm
f2deb5e40c stress2: Added a timeout 2022-06-21 10:20:43 +02:00
Alan Cox
0ba1d86082 iommu_gas: Add a missing error-case unlock
Release the domain lock when iommu_gas_reserve_region_extend()'s call to
iommu_gas_reserve_region_locked() fails.

MFC after:	2 weeks
2022-06-20 23:48:31 -05:00
Alan Cox
32e82bcc15 busdma_iommu: Eliminate a redundant trunc_page()
Since OFF_TO_IDX() inherently truncates the given value, there is no
need to perform trunc_page() on it.

MFC after:	2 weeks
2022-06-20 23:03:04 -05:00
Doug Moore
70b5d8fa0f iommu_gas: Drop needless bound check in lowermatch
The loop iteration in iommu_gas_lowermatch checks the bound
a->common->lowaddr twice per loop iteration. Rewrite to test only once
per iteration.  Do not worry about passing to iommu_gas_match_one a
range wholly beyond lowaddr. Since that function checks the upper end
of the range against lowaddr, it'll get rejected there.

Reviewed by:	alc
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D35522
2022-06-20 19:34:46 -05:00
Rick Macklem
0586a12904 nfscl: Clean up the code by removing vfs_flags() macro
The vfs_flags() macro was used to make the code compatible
with Mac OSX, for the Mac OSX port.
For FreeBSD, this macro just obscured the code, so
remove it to clean up the code.

This commit should not result in a semantics change.
2022-06-20 13:23:04 -07:00
Alan Cox
164491fb03 iommu_gas: Eliminate a stale comment
As of 19bb5a7244, the size passed to iommu_gas_map is no longer
required to be a multiple of the CPU page size.

MFC after:	2 weeks
2022-06-20 12:30:36 -05:00
Mark Johnston
6405997f45 kevent.2: Add an xref to listen.2
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-06-20 12:48:14 -04:00
Mark Johnston
e123264e4d vm: Fix racy checks for swap objects
Commit 4b8365d752 introduced the ability to dynamically register
VM object types, for use by tmpfs, which creates swap-backed objects.
As a part of this, checks for such objects changed from

  object->type == OBJT_DEFAULT || object->type == OBJT_SWAP

to

  object->type == OBJT_DEFAULT || (object->flags & OBJ_SWAP) != 0

In particular, objects of type OBJT_DEFAULT do not have OBJ_SWAP set;
the swap pager sets this flag when converting from OBJT_DEFAULT to
OBJT_SWAP.

A few of these checks are done without the object lock held.  It turns
out that this can result in false negatives since the swap pager
converts objects like so:

  object->type = OBJT_SWAP;
  object->flags |= OBJ_SWAP;

Fix the problem by adding explicit tests for OBJT_SWAP objects in
unlocked checks.

PR:		258932
Fixes:		4b8365d752 ("Add OBJT_SWAP_TMPFS pager")
Reported by:	bdrewery
Reviewed by:	kib
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35470
2022-06-20 12:48:14 -04:00
Mark Johnston
9553bc89db aio: Improve UMA usage
- Remove the AIO proc zone.  This zone gets one allocation per AIO
  daemon process, which isn't enough to warrant a dedicated zone.  Plus,
  unlike other AIO structures, aiops are small (32 bytes with LP64), so
  UMA doesn't provide better space efficiency than malloc(9).  Change
  one of the malloc types in vfs_aio.c to make it more general.

- Don't set the NOFREE flag on the other AIO zones.  This flag means
  that memory allocated to the AIO subsystem is never freed back to the
  VM, so it's always preferable to avoid using it when possible.  NOFREE
  was set without explanation when AIO was converted to use UMA 20 years
  ago, but it does not appear to be required; all of the structures
  allocated from UMA (per-process kaioinfo, kaiocb, and aioliojob) keep
  track of references and get freed only when none exist.  Plus, these
  structures will contain dangling pointer after they're freed (e.g.,
  the "cred", "fd_file" and "uiop" fields of struct kaiocb), so
  use-after-frees are dangerous even when the structures themselves are
  type-stable.

Reviewed by:	asomers
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35493
2022-06-20 12:48:13 -04:00
Mark Johnston
60b4ad4b6b bpf: Zero pad bytes preceding BPF headers
BPF headers are word-aligned when copied into the store buffer.  Ensure
that pad bytes following the preceding packet are cleared.

Reported by:	KMSAN
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-06-20 12:48:13 -04:00
Mark Johnston
c88f6908b4 bpf: Correct a comment
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-06-20 12:48:13 -04:00
Mark Johnston
540da48d83 vm_kern: Update KMSAN shadow maps when allocating kmem memory
This addresses a couple of false positive reports for memory returned by
malloc_large().

Sponsored by:	The FreeBSD Foundation
2022-06-20 12:48:13 -04:00
Mark Johnston
a932a5a649 uma: Mark zeroed slabs as initialized for KMSAN
Otherwise zone initializers can produce false positives, e.g., when
lock_init() attempts to detect double initialization.

Sponsored by:	The FreeBSD Foundation
2022-06-20 12:48:13 -04:00
Cy Schubert
3b29567810 wpa: Restore missing patch
In December after a failed MFV due to a now understood issue I had with
git -- git aborts with extremely large MFV -- this patch was removed
during the revert. Restore this patch.

PR:		264238
Fixes:		4b72b91a71
MFC after:	1 week
2022-06-20 07:25:35 -07:00
Peter Holm
f2c88ed6ba stress2: Added a timeout to the test 2022-06-20 14:36:57 +02:00
Peter Holm
e2c59d8dff stress2: Fix process handling error 2022-06-20 14:35:59 +02:00
Kristof Provost
3fccdfab64 pf tests: basic 'tagged' test for Ethernet rules
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D35364
2022-06-20 10:16:20 +02:00
Kristof Provost
7b271afd62 pf tests: basic 'tagged' test for Ethernet rules
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D35363
2022-06-20 10:16:20 +02:00
Kristof Provost
1f61367f8d pf: support matching on tags for Ethernet rules
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D35362
2022-06-20 10:16:20 +02:00
Toomas Soome
e417249016 loader: GELI encrypted disk should still use device name disk
geli_probe_and_attach() does pick geli_devsw structure for
encrypted disks, the implementation depends on device
name "disk" when device type is DEVT_DISK, but geli_devsw is
setting name field "gelidisk".

PR:		264282
Submitted by:	yamagi@yamagi.org
Reported by:	yamagi@yamagi.org
MFC after:	2 weeks
2022-06-20 10:10:14 +03:00
Fernando Apesteguía
9acb1d7b2c getnetent(3): Add documentation for missing reentrant functions
Add gethostbyname_r, gethostbyname2_r and gethostbyaddr_r signatures and
descriptions.

PR:	249154
Reported by:	asomers@
Approved by:	manpages (imp@), Pau Amma
Differential Revision: https://reviews.freebsd.org/D30385
2022-06-20 07:30:38 +02:00
Fernando Apesteguía
dc68997328 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
2022-06-20 07:23:53 +02:00