Commit graph

266895 commits

Author SHA1 Message Date
Gordon Bergling
d843e777a5 netinet: Fix a common typo in source code comments
- s/writting/writing/

(cherry picked from commit bb91496a85)
2021-11-06 08:52:38 +01:00
Gordon Bergling
16f3658c7d ocs_fs: Fix two typos in source code comments
- s/maxium/maximum/
- s/maxiumum/maximum/

(cherry picked from commit 7b56cb0462)
2021-11-06 08:52:09 +01:00
Gordon Bergling
946bce41ed gjournal(8): Fix a typo in a source code comment
- s/writting/writing/

(cherry picked from commit 9d2e51884e)
2021-11-06 08:51:45 +01:00
Gordon Bergling
beaf14a65b ng_pptpgre(4): Fix a typo in a source code comment
- s/mimimum/minimum/

(cherry picked from commit 40a57b00f9)
2021-11-06 08:50:54 +01:00
Gordon Bergling
0a5b6cde28 ixgbe(4): Fix a few typos in source code comments
- s/Manageblility/Managebility/
- s/alows/allows/

Obtained from:	NetBSD

(cherry picked from commit 8da5034954)
2021-11-06 08:50:23 +01:00
Konstantin Belousov
9de9a33050 fexecve(2): allow O_PATH file descriptors opened without O_EXEC
(cherry picked from commit be10c0a910)
2021-11-06 04:12:33 +02:00
Konstantin Belousov
ba058d44b3 procfs_doprocfile(): simplify
(cherry picked from commit 15bd9fa3be)
2021-11-06 04:12:32 +02:00
Konstantin Belousov
5291b294d3 proc_get_binpath(): provide syntaxically correct value for unused NDINIT arg
(cherry picked from commit 7ac82c96fe)
2021-11-06 04:12:32 +02:00
Konstantin Belousov
392fbf5cce proc_get_binpath(): return empty string instead of NULL
(cherry picked from commit 02de91d740)
2021-11-06 04:12:32 +02:00
Konstantin Belousov
17aab23bf7 fexecve(2): restore the attempts to calculate the executable path
(cherry picked from commit e4ce23b238)
2021-11-06 04:12:32 +02:00
Konstantin Belousov
f61af036ab procfs: return right hardlink from /proc/curproc/file
PR:	248184

(cherry picked from commit e5248548f9)
2021-11-06 04:12:32 +02:00
Konstantin Belousov
0303cc4be8 Extract proc_get_binpath() from sysctl_kern_proc_pathname()
(cherry picked from commit f34fc6ba06)
2021-11-06 04:12:32 +02:00
Konstantin Belousov
52e2887d1d sys/proc.h: put proc_add_orphan() into proper place
(cherry picked from commit b4c7d45c84)
2021-11-06 04:12:32 +02:00
Konstantin Belousov
ea4e8e191c sysctl kern.proc.procname: report right hardlink name
PR:	248184

(cherry picked from commit ee92c8a842)
2021-11-06 04:12:32 +02:00
Konstantin Belousov
d39bd6d14d exec: store parent directory and hardlink name of the binary in struct proc
(cherry picked from commit 351d5f7fc5)
2021-11-06 04:12:32 +02:00
Konstantin Belousov
a69fb7452e exec: provide right hardlink name in AT_EXECPATH
PR:	248184

(cherry picked from commit 0c10648fbb)
2021-11-06 04:12:31 +02:00
Konstantin Belousov
b94df11d52 Make vn_fullpath_hardlink() externally callable
(cherry picked from commit 9a0bee9f6a)
2021-11-06 04:12:31 +02:00
Konstantin Belousov
1849361644 struct image_params: use bool type for boolean members
(cherry picked from commit 15bf81f354)
2021-11-06 04:12:31 +02:00
Konstantin Belousov
3b4baefca9 do_execve(): switch boolean locals to use bool type
(cherry picked from commit 9d58243fbc)
2021-11-06 04:12:31 +02:00
Konstantin Belousov
0b06c284ae kern_exec.c: style
(cherry picked from commit 143dba3a91)
2021-11-06 04:12:31 +02:00
Dimitry Andric
344691934f llvm BPF target: add missed source files
Otherwise, linking llvm binaries with this target enabled (which is not
the default) will fail with a number of undefined symbol errors:

  ld: error: undefined symbol: llvm::initializeBPFAdjustOptPass(llvm::PassRegistry&)
  ld: error: undefined symbol: llvm::initializeBPFCheckAndAdjustIRPass(llvm::PassRegistry&)
  ld: error: undefined symbol: llvm::createBPFCheckAndAdjustIR()
  ld: error: undefined symbol: llvm::createBPFAdjustOpt()
  ld: error: undefined symbol: llvm::BPFAdjustOptPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&)

Reported by:	Michael Dexter <editor@callfortesting.org>

(cherry picked from commit d30dc78f79)
2021-11-05 17:10:14 +01:00
Leandro Lupori
8a62b07bce powerpc64le: stand fixes
Fix boot1 and loader on PowerPC64 little-endian (LE).

Due to endian issues, boot1 couldn't find the UFS boot partition
and loader wasn't able to load the kernel. Most of the issues
happened because boot1 and loader were BE binaries trying to access
LE UFS partitions and because loader expects the kernel ELF image
to use the same endian as itself.

To fix these issues, boot1 and loader are now built as LE binaries
on PPC64LE. To support this, the functions that call OpenFirmware
were enhanced to correctly perform endian conversion on its input
and output arguments and to change the CPU into BE mode before
making the calls, as OpenFirmware always runs in BE. Besides that,
some other small fixes were needed.

Submitted by:		bdragon (initial version)
Reviewed by:		alfredo, jhibbits
Sponsored by:		Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D32160

(cherry picked from commit f83288645c)
2021-11-05 11:29:40 -03:00
Leandro Lupori
84800daacf powerpc64: fix OFWFB with Radix MMU
Current implementation of Radix MMU doesn't support mapping
arbitrary virtual addresses, such as the ones generated by
"direct mapping" I/O addresses. This caused the system to hang, when
early I/O addresses, such as those used by OpenFirmware Frame Buffer,
were remapped after the MMU was up.

To avoid having to modify mmu_radix_kenter_attr just to support this
use case, this change makes early I/O map use virtual addresses from
KVA area instead (similar to what mmu_radix_mapdev_attr does), as
these can be safely remapped later.

Reviewed by:		alfredo (earlier version), jhibbits (in irc)
Sponsored by:		Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D31232

(cherry picked from commit 76384bd10f)
2021-11-05 11:08:27 -03:00
Lakshman
3530ba8cc1 efirt(9): Correct efi_var_set definition in the manpage
PR:		257531

(cherry picked from commit 2fe85640b2)
2021-11-05 00:59:54 -04:00
Felix Johnson
78bec4ed64 devinfo(8): Remove cross-reference to pnpinfo(8)
devinfo(8) manpage contains reference to pnpinfo(8) which existed at the
time. Remove it.

PR:		232587
Reported by:	Graham Perrin <grahamperrin@gmail.com>

(cherry picked from commit dde6071adc)
2021-11-05 00:54:33 -04:00
Cy Schubert
ef1134110e wpa: Fix WITHOUT_CRYPT build
PASN requires CRYPT and when built WITHOUT_CRYPT buildworld
fails. Only enable PASN when MK_CRYPT is enabled (default).

PR:		259517
Reported by:	emaste
Fixes:		c1d255d3ff

(cherry picked from commit a30e8044aa)
2021-11-04 11:30:25 -07:00
Cy Schubert
33b73d010d wpa: Address CTRL-EVENT-SCAN-FAILED
5fcdc19a81 didn't fully resolve the issue. There remains a report
that an ifconfig wlan0 up by itself is insufficient. Ifconfig down
must precede it.

Reported by:	Filipe da Silva Santos <contact _ shiori_com_br>
Fixes:		5fcdc19a81

(cherry picked from commit d06d7eb091)
2021-11-04 11:30:25 -07:00
Cy Schubert
f9d2cbc6a5 wpa: Address CTRL-EVENT-SCAN-FAILED
Some installations may experience CTRL-EVENT-SCAN-FAILED when
associating to an AP. Installations that specify
ifconfig_wlan0="WPA ... up" in rc.conf do not experience
the problem whereas those which specify ifconfig_wlan0="WPA" without
the "up" will experience CTRL-EVENT-SCAN_FAILED.

However those that specify "up" in ifconfig_wlan0 will be able to
reproduce this problem by service netif stop wlan0;
service netif start wlan0. Interestingly The service netif stop/start
problem is reproducible on the older wpa 2.9 as well.

Reported by:	dhw
Reported by:	"Oleg V. Nauman" <oleg _ theweb_org_ua>
Reported by:	Filipe da Silva Santos <contact _ shiori_com_br>
Reported by:	Jakob Alvermark <jakob _ alvermark_net>

(cherry picked from commit 5fcdc19a81)
2021-11-04 11:30:25 -07:00
Cy Schubert
580c04df4d wpa: Enable RSN Preauthentication
RSN Preauthentication allows a station autnetnicate to an AP that
it is not associated with yet while associated with a different AP.
This allows athentication to multiple APs simulteneously.

Tested by:	philip

(cherry picked from commit bd452dcbed)
2021-11-04 11:30:24 -07:00
Cy Schubert
3f3676a712 wpa: Enable MBO
Enable WiFi 6 MBO (Multi Band Operation). MBO is a prereq to 802.11ax.

MBO allows the efficient use of multiple frequency bands (channels).

To facilitate MBO, WNM (Wireless Network Monitoring) is a prerequisite.
It is required to build.

Tested by:	philip

(cherry picked from commit 3968b47cd9)
2021-11-04 11:30:24 -07:00
Cy Schubert
0a6760a1de wpa: Import wpa_supplicant/hostapd commits up to b4f7506ff
Merge vendor commits 40c7ff83e7,
efec822389, and
2f6c3ea960.

Tested by:	philip

(cherry picked from commit c1d255d3ff)
2021-11-04 11:30:24 -07:00
Konstantin Belousov
3e322ded35 Unmap shared page manually before doing vm_map_remove() on exit or exec
(cherry picked from commit 1c69690319)
2021-11-04 02:56:39 +02:00
Konstantin Belousov
077d3c4c46 amd64 pmap: adjust the empty pmap optimization in pmap_remove()
(cherry picked from commit 0b3bc72889)
2021-11-04 02:56:39 +02:00
Konstantin Belousov
2f71c973ef amd64 pmap: account for the top-level pages
(cherry picked from commit e93b5adb6b)
2021-11-04 02:56:39 +02:00
Sebastian Huber
b765d3da06 kern_tc.c: Scaling/large delta recalculation
(cherry picked from commit ae750fbac7)
2021-11-04 02:56:38 +02:00
Ed Maste
70cb6c34bb Force WITHOUT_OPENSSL_KTLS off when WITHOUT_OPENSSL
Discussed with:	jhb
MFC after:	1 week
Reported by:	Michael Dexter, Build Option Survey
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 6940d0e470)
2021-11-03 20:41:11 -04:00
Ed Maste
1da2deab7c iscsid: set max_recv_data_segment_length to what we advertise
Previously we updated the conection's conn_max_recv_data_segment_length
only when we received a response containing MaxRecvDataSegmentLength
from the target.  If the target did not send MaxRecvDataSegmentLength
then we left conn_max_recv_data_segment_length at the default (i.e.,
8192).  A target could then send more data than that defult (up to our
advertised maximum), and we would drop the connection.

RFC 7143 specifies that MaxRecvDataSegmentLength is Declarative, not
negotiated.  Just set conn_max_recv_data_segment_length to our
advertised value in login_negotiate().

PR:		259355
Reviewed by:	mav
MFC after:	1 week
Fixes:		a15fbc904a ("Alike to r312190 decouple iSCSI...")
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32605

(cherry picked from commit fc79cf4fea)
2021-11-03 16:47:11 -04:00
Mark Johnston
5dc9004b72 vm_page: Break reservations to handle noobj allocations
vm_reserv_reclaim_*() will release pages to the default freepool, not
the direct freepool from which noobj allocations are drawn.  But if both
pools are empty, the noobj allocator variants must break reservations to
make progress.

Reported by:	cy
Reviewed by:	kib (previous version)
Fixes:	b498f71bc5 ("vm_page: Add a new page allocator interface for unnamed pages")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit d7acbe481d)
2021-11-03 13:44:47 -04:00
Mark Johnston
a6922417a0 Use the vm_radix_init() helper when initializing pmaps
No functional change intended.

Reviewed by:	alc, kib
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit ff93447d8e)
2021-11-03 13:42:21 -04:00
Mark Johnston
0fcf472fd5 amd64: Add comments to pmap_pinit_type()
... explaining why we don't pass the pmap pointer to
pmap_alloc_pt_page().

Reported by:	alc
Reviewed by:	alc, kib
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 34fac29e98)
2021-11-03 13:41:55 -04:00
Mark Johnston
f86bda068c Convert consumers to vm_page_alloc_noobj_contig()
Remove now-unneeded page zeroing.  No functional change intended.

Reviewed by:	alc, hselasky, kib
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 84c3922243)
2021-11-03 13:41:40 -04:00
Mark Johnston
fb3ba080a1 Introduce vm_page_alloc_noobj_contig()
This is the same as vm_page_alloc_noobj(), but allocates physically
contiguous runs of memory.  For now it is implemented in terms of
vm_page_alloc_contig(), with the difference that
vm_page_alloc_noobj_contig() implements VM_ALLOC_ZERO by zeroing the
page.

Reviewed by:	alc, kib
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 92db9f3bb7)
2021-11-03 13:41:00 -04:00
Mark Johnston
66cb1858f4 Convert vm_page_alloc() callers to use vm_page_alloc_noobj().
Remove page zeroing code from consumers and stop specifying
VM_ALLOC_NOOBJ.  In a few places, also convert an allocation loop to
simply use VM_ALLOC_WAITOK.

Similarly, convert vm_page_alloc_domain() callers.

Note that callers are now responsible for assigning the pindex.

Reviewed by:	alc, hselasky, kib
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit a4667e09e6)
2021-11-03 13:39:36 -04:00
Mark Johnston
24204bede3 vm_page: Add a new page allocator interface for unnamed pages
The diff adds vm_page_alloc_noobj() and vm_page_alloc_noobj_domain().
These mostly correspond to vm_page_alloc() and vm_page_alloc_domain()
when no VM object is specified, with the exception that they handle
VM_ALLOC_ZERO by zeroing the page, rather than by preserving PG_ZERO.

This simplifies callers and will permit simplification of the
vm_page_alloc_domain() definition.

Since the new allocator variant is similar to vm_page_alloc_freelist(),
implement both of them using a common backend allocator function.  No
functional change intended.

Reviewed by:	alc, kib
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit b498f71bc5)
2021-11-03 13:35:25 -04:00
Ryan Stone
8deb5f2f64 Add a VM flag to prevent reclaim on a failed contig allocation
If a M_WAITOK contig alloc fails, the VM subsystem will try to
reclaim contiguous memory twice before actually failing the
request.  On a system with 64GB of RAM I've observed this take
400-500ms before it finally gives up, and I believe that this
will only be worse on systems with even more memory.

In certain contexts this delay is extremely harmful, so add a flag
that will skip reclaim for allocation requests to allow those
paths to opt-out of doing an expensive reclaim.

Sponsored by: Dell Inc
Differential Revision:	https://reviews.freebsd.org/D28422
Reviewed by: markj, kib

(cherry picked from commit 660344ca44)
2021-11-03 13:35:16 -04:00
Mark Johnston
009b4d7190 vlapic: Schedule callouts on the local CPU
The virtual LAPIC driver uses callouts to implement the LAPIC timer.
Callouts are armed using callout_reset_sbt(), which currently puts
everything on CPU 0.  On systems running many bhyve VMs this results in
a large amount of contention for CPU 0's callout lock.

Modify vlapic to schedule callouts on the local CPU instead.  This
allows timer interrupts to be scheduled more evenly among CPUs where
bhyve is running.

Reviewed by:	grehan, jhb
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 4c812fe61b)
2021-11-03 09:15:18 -04:00
Mark Johnston
b5e5020260 rmslock: Update td_locks during lock and unlock operations
Reviewed by:	mjg
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 71f31d784e)
2021-11-03 09:15:05 -04:00
Mark Johnston
36ca4b79b8 amd64: Define KVA regions for KMSAN shadow maps
KMSAN requires two shadow maps, each one-to-one with the kernel map.
Allocate regions of the kernels PML4 page for them.  Add functions to
create mappings in the shadow map regions, these will be used by the
KMSAN runtime.

Reviewed by:	alc, kib
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit f95f780ea4)
2021-11-02 18:17:58 -04:00
Mark Johnston
5fdfe78b42 conf: Add a KMSAN kernel option
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 30d00832d7)
2021-11-02 18:17:58 -04:00
Mark Johnston
10d94487df kasan: Use vm_offset_t for the first parameter to kasan_shadow_map()
No functional change intended.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 20e3b9d8bd)
2021-11-02 18:17:58 -04:00