Commit Graph

279302 Commits

Author SHA1 Message Date
Anton Rang
cfbf1da0de vm_page_unswappable: remove wrong assertion
markj says:

    ...the assertion is incorrect and should simply be removed.
    It has been racy since we removed the use of the page hash
    lock to synchronize wiring of pages.

PR:		267621
Reviewed by:	markj, Anton Rang <rang@acm.org>
MFC after:	1 week
Sponsored by:	Dell Inc.
Differential Revision:	https://reviews.freebsd.org/D37320
2022-11-09 14:28:03 -06:00
Kirk McKusick
460ed6106c Add support for managing UFS/FFS snapshots to fsck_ffs(8).
The kernel handles the managment of UFS/FFS snapshots. Since UFS/FFS
updates filesystem data (rather than always writing changes to new
locations like ZFS), the kernel must check every filesystem write
to see if the block being written is part of a snapshot. If it is
part of a snapshot, then the kernel must make a copy of the old
block value into a newly allocated block for the snapshot before
allowing the write to be done. Similarly, if a block is being freed,
the kernel must check to see if it is part of a snapshot and let
the snapshot claim the block rather than freeing it for future use.
When a snapshot is freed, its blocks need to be offered to older
snapshots and freed only if no older snapshots wish to claim them.

When snapshots were added to UFS/FFS they were integrated into soft
updates and just a small part of the management of snapshots needed
to be added to fsck_ffs(8) as soft updates minimized the set of
snapshot changes that might need correction. When journaling was
added to soft updates a much more complete knowledge of snapshots
needed to be added to fsck_ffs(8) for it to be able to properly
handle the filesystem changes that a journal rollback needs to do
(specifically the freeing and allocation of blocks). Since this
functionality was unavailable, the use of snapshots was disabled
when running with journaled soft updates.

This set of changes imports the kernel code for the management of
snapshots to fsck_ffs(8). With this code in place it will become
possible to enable snapshots when running with journalled soft
updates. The most immediate benefit will be the ability to use
snapshots to take consistent filesystem dumps on live filesystems.
Future work will be done to update fsck_ffs(8) to be able to use
snapshots to run in background on live filesystems running with
journaled soft updates.

Reviewed by:  kib
Tested by:    Peter Holm
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36491
2022-11-09 10:46:31 -08:00
Alan Somers
05d0f4308c Don't panic when tasting a disk with sectorsize=0
This can sometimes happen with broken HDDs.

MFC after:	2 weeks
Sponsored by:	Axcient
Reviewed by:	markj
Differential Revision: https://reviews.freebsd.org/D37313
2022-11-09 10:21:12 -07:00
Dag-Erling Smørgrav
817f1f3064 libc: Don't warn about RRSIG replies.
PR:		213178
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D37303
2022-11-09 17:41:47 +01:00
Ed Maste
733bf3b108 ssh: update comment text to match upstream
Reported by:	bz
Obtained from:	OpenSSH dffa64480163
2022-11-09 11:32:47 -05:00
Richard Scheffenegger
0b00b80149 ipfw: Have NAT steal the TH_RES1 bit, instead of the TH_AE bit
The NAT module use of the tcphdr.th_x2 field now collides with the
use of this TCP header flag as AccECN (AE) bit. Use the topmost
bit instead to allow negotiation of AccECN across a NAT device.

Event:			IETF 115 Hackathon
Reviewed By:		#transport, tuexen
MFC after:		3 days
Sponsored by:		NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D37300
2022-11-09 11:19:19 +01:00
Baptiste Daroussin
0b1adc42a1 rc.sendmail: remove unused script
20 years ago the use of rc.sendmail script was dropped in favor
of /etc/rc.d/sendmail, it is time to retire the script entirely
now.

MFC after:	1 week
2022-11-09 16:55:18 +01:00
Baptiste Daroussin
6a2d6a569b rc.conf(5): fix the description of mta_start_script
mta_start_script is used by /etc/rc.d/othermta which only execute
something if this variable is set to something else than
/etc/rc.sendmail

MFC after:	1 week
2022-11-09 16:55:18 +01:00
Jose Luis Duran
c7c9836853 sendmail: Add back a comment about "NONE"
Differential Revision:	https://reviews.freebsd.org/D37315
2022-11-09 16:54:34 +01:00
Baptiste Daroussin
7cadc52638 sendmail: do not use NONE
NONE is deprecated, instead of using NONE, switch to "NO" all
the sendmail_*_enable which sendmail_enable=NONE would have done
2022-11-09 15:20:30 +01:00
Kyle Evans
d22f03636b mktemp: skip later TMPDIR check if -p is specified
We already did the necessary $TMPDIR fallback, if it's going to be used.
Skip the later check so that we don't accidentally override our -p
argument.

Fixes:		ac6f924e1c ("mktemp: add -p/--tmpdir argument")
Sponsored by:	Klara, Inc.
2022-11-09 00:04:04 -06:00
Mateusz Guzik
83286682f8 vfs: whack mips remnant
This reverts commit 8ffa01a061.
2022-11-09 00:31:50 +00:00
Ed Maste
185efcc376 tests: also remove sparc64 case
Followup to commit d6273acf56, which removed MIPS.

Reported by:	mhorne
2022-11-08 18:55:00 -05:00
Alex S
9f7bf94ee2 linux(4): Fix get_robust_list() syscall return value.
The system call returns the head of the robust futex list. The list head is stored
in the location pointed to by the head argument. When copying data between address
spaces use proper head storage size as it depends on an emulated ABI.

PR:		267616
MFC after:	3 days
2022-11-09 00:17:17 +03:00
Gleb Smirnoff
b40ae8c9fe tcp: fix build without INVARIANTS and VIMAGE
Lines from upcoming changes crept in and broke certain builds.

Fixes:	9eb0e8326d
2022-11-08 12:34:45 -08:00
John Baldwin
e4bc19b2fa cxgbe tom: Fix jobtotid() compilation.
The previous commit lost an implicit struct socket * cast.  Use an
inline function instead as the macro is already rather long.

Fixes:		e1401f7579 cxgbe: use standard sototcpcb() accessor macro to get socket's tcpcb
Sponsored by:	Chelsio Communications
2022-11-08 11:25:58 -08:00
Gleb Smirnoff
326f455625 tcp: forward declare struct tcpcb in the TCP logging header
This allows to include tcp_log_buf.h without including tcp_var.h.
2022-11-08 10:32:29 -08:00
Gleb Smirnoff
73bebcc5bd inpcb: remove TCP includes, all TCP specific code was moved 2022-11-08 10:24:40 -08:00
Gleb Smirnoff
8840ae2288 tcp: don't store VNET in every tcpcb, take it from the inpcbinfo
Reviewed by:		rscheff
Differential revision:	https://reviews.freebsd.org/D37125
2022-11-08 10:24:40 -08:00
Gleb Smirnoff
ab0ef9455f hpts: move inp initialization from the generic inpcb code to TCP
Differential revision:	https://reviews.freebsd.org/D37124
2022-11-08 10:24:40 -08:00
Gleb Smirnoff
9eb0e8326d tcp: provide macros to access inpcb and socket from a tcpcb
There should be no functional changes with this commit.

Reviewed by:		rscheff
Differential revision:	https://reviews.freebsd.org/D37123
2022-11-08 10:24:40 -08:00
Gleb Smirnoff
f71cb9f748 tcp: inp_socket is valid through the lifetime of a TCP inpcb
The inp_socket is cleared only in in_pcbdetach(), which for TCP is
always accompanied with inp_pcbfree().  An inpcb that went through
in_pcbfree() shall never be returned by any kind of pcb lookup.

Reviewed by:		tuexen
Differential revision:	https://reviews.freebsd.org/D37062
2022-11-08 10:24:39 -08:00
Gleb Smirnoff
ada90cb978 tcp: remove INP_DROPPED check from notify functions
These functions tcp_notify(), tcp_drop_syn_sent() and tcp_mtudisc()
are called from tcp*_ctlinput*() right after successfull
in_pcblookup*().  They shall never get a pcb that is dropped.
2022-11-08 10:24:39 -08:00
Gleb Smirnoff
f567d55f51 inpcb: don't return INP_DROPPED entries from pcb lookups
The in_pcbdrop() KPI, which is used solely by TCP, allows to remove a
pcb from hash list and mark it as dropped.  The comment suggests that
such pcb won't be returned by lookups.  Indeed, every call to
in_pcblookup*() is accompanied by a check for INP_DROPPED.  Do what
comment suggests: never return such pcbs and remove unnecessary checks.

Reviewed by:		tuexen
Differential revision:	https://reviews.freebsd.org/D37061
2022-11-08 10:24:39 -08:00
Bjoern A. Zeeb
b5c3819c7b LinuxKPI: add virt_to_phys()
Add virt_to_phys() as a define to vtophys().
This is used by a wireless driver for dma related work; sigh.

MFC after:	3 days
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D37301
2022-11-08 18:18:01 +00:00
Bjoern A. Zeeb
f2978460c7 LinuxKPI: tasklet add (*callback) support
In addition to (*func) tasklet also seems to have a (*callback) with
a different argument.  Add support for this and add tasklet_setup()
as well for support in more drivers.

The from_tasklet() definition is duplicated in the tree; hide it there
under #ifndef to avoid a re-definition.  People should generally add
LinuxKPI bits to linuxkpi rather than private files if they also rely
on other LinuxKPI bits.

X-MFC:		DO NOT MFC, space allocated by drivers not us.
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D37216
2022-11-08 18:14:17 +00:00
Bjoern A. Zeeb
e2361e04b0 LinuxKPI: implement cpumask_of()
Add a static set of cpumasks for all (possible) cpus with only the one
indexed cpu enabled in each set.
This is needed for cpumask_of(_cpuid) which returns a cpumask (cpuset)
with only cpu _cpuid enabled and is used by one wireless driver at least.

MFC after:	3 days
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D37223
2022-11-08 18:11:55 +00:00
Richard Scheffenegger
dc9daa04fb tcp: allow packets to be marked as ECT1 instead of ECT0
This adds the capability for a modular congestion control
to select which variant of ECN-capable-transport it wants to use
when sending out elegible segments. As an initial CC to utilize
this, DCTCP was selected.

Event:			IETF 115 Hackathon
Reviewed By:		tuexen, #transport
Sponsored by:		NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D24869
2022-11-08 18:36:38 +01:00
Ed Maste
d6273acf56 tests: retire now-unused MIPS case 2022-11-08 09:17:53 -05:00
Gordon Bergling
bcf8fb7f03 tcp_bbr(4): Fix a typo in a source code comment
- s/retranmitted/retransmitted/

MFC after:	3 days
2022-11-08 14:59:56 +01:00
Gordon Bergling
bf31248287 nfs: Fix common typos in source code comments
- s/attrbute/attribute/

MFC after:	3 days
2022-11-08 14:58:32 +01:00
Gordon Bergling
40b245af0f pnfs.4: Fix a typo
- s/attrbute/attribute/

MFC after:3 days
2022-11-08 14:57:06 +01:00
Baptiste Daroussin
b7104f1914 sendmail: document that sendmail_enable can be set to NONE
setting sendmail_enable to NONE (which is now the default)
turns all the sendmail_*_enable variables to NO

Reported by:	many
2022-11-08 14:39:27 +01:00
Jakub Kołodziej
f1717ffd7a gpio: Fix typo causing GPIO configuration mismatch
Polarity inversion register was mistekanly filled with the value of
the direction configuration register.
Correct that.

Reviewed by:	kd
Obtained from:	Semihalf
Differential Revision: https://reviews.freebsd.org/D37262
2022-11-08 14:14:59 +01:00
Baptiste Daroussin
1edc3b6e56 netlink: unregister groups along with family
Differential Revision:	https://reviews.freebsd.org/D37308
Reviewed by:	melifaro
2022-11-08 12:46:58 +01:00
Mateusz Guzik
b935e867af Tree-wide replacement of VOP_UNLOCK + vrele combo with vput
No functional changes.
2022-11-07 23:34:27 +00:00
John Baldwin
613aaf59af git-arc: Accept message via -m when updating reviews.
If a -m argument is given to update, it is passed through to arc diff
when updating each review.  Note that if an empty message is specified
via -m, arc diff will update the review without adding a note.

If an -m argument is not given, then the user's editor is invoked by
arc to supply a message for each review matching the previous
behavior.

This can be used to simplify the process for updating a set of
reviews, e.g.:

  git checkout foo
  git rebase main
  git arc update -m "Rebase" main..

This will rebase the 'foo' branch and update the reviews for all
commits on the branch without invoking the user's editor separately
for each review.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D37260
2022-11-07 14:46:15 -08:00
Kirk McKusick
f515a279f7 Clean up error output for extended attributes in fsck_ffs(8).
MFC after:    1 week
Sponsored by: The FreeBSD Foundation
2022-11-07 14:32:42 -08:00
Navdeep Parhar
118cfb829f pciconf(8): Decode ACS extended capability.
MFC after:	1 week
Sponsored by:	Chelsio Communications
Reviewed by:	kib@
Differential Revision:	https://reviews.freebsd.org/D37271
2022-11-07 13:20:22 -08:00
Navdeep Parhar
b2700160cc pcireg.h: Add values for ACS PCIe Extended capability.
These values come from section 7.7.11 ("ACS Extended Capability") of the
PCI Express Base Specification Revision 6.0, dated 16 Dec 2021.

MFC after:	1 week
Sponsored by:	Chelsio Communications
Reviewed by:	kib@
Differential Revision:	https://reviews.freebsd.org/D37270
2022-11-07 13:20:21 -08:00
Mark Johnston
3c0e9169a3 ksan: Build sanitizer runtimes without stack-smashing protection
On arm64 with per-thread stack canaries enabled (the PERTHREAD_SSP
option), the compiler may load curthread->td_md.md_canary in function
prologues.  This is not safe in data_abort(); see commit 2c10be9e06.
Thus, sanitizer runtimes must also avoid accessing the current thread's
canary.

Since SSP has limited utility in sanitizer runtimes, simply disable it
unconditionally to avoid unpleasant surprises in the future.

MFC after:	2 weeks
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
2022-11-07 16:10:48 -05:00
Mark Johnston
03bf40c5d8 arm64: Disable per-thread stack-smashing protection in data_abort()
With PERTHREAD_SSP configured, the compiler's stack-smashing protection
uses a per-thread canary value instead of a global value.  The value is
stored in td->td_md.md_canary; the sp_el0 register always contains a
pointer to that value, and certain functions selected by the compiler
will store the canary value on the stack as a part of the function
prologue (and will verify the copy as part of the epilogue).  In
particular, the thread structure may be accessed.

This happens to occur in data_abort(), which leads to the same problem
addressed by commit 2c10be9e06 ("arm64: Handle translation faults for
thread structures").  This commit fixes that directly, by disabling SSP
in data_abort() and a couple of related functions by using a function
attribute.  It also moves the update of sp_el0 out of C code in case
the compiler decides to start checking the canary in pmap_switch()
someday.

A different solution might be to move the canary value to the PCB, which
currently lives on the kernel stack and isn't subject to the same
problem as thread structures (if only because guard pages inhibit
superpage promotion).  However, there isn't any particular reason the
PCB has to live on the stack today; on amd64 it is embedded in struct
thread, reintroducing the same problem.  Keeping the reference canary
value at the top of the stack is also rather dubious since it could be
clobbered by a sufficiently large stack overflow.

A third solution could be to go back to the approach of commit
5aa5420ff2, and modify UMA to use the direct map for thread structures
even if KASAN is enabled.  But, transient promotions and demotions in
the direct map are possible too.

Reviewed by:	alc, kib, andrew
MFC after:	1 month
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D37255
2022-11-07 16:05:58 -05:00
Ed Maste
4232f36eda sshd: sync tracing disable with upstream
Old versions of FreeBSD do not support using id 0 to refer to the
current pid for procctl, so pass getpid() explicitly.

Although this is not required in current FreeBSD branches I am merging
it to reduce differences with upstream.

Obtained from:	OpenSSH commit 0f7e1eba5525
2022-11-07 12:23:00 -05:00
Li-Wen Hsu
82e4a85de5
netlink: connect netlink(4), rtnetlink(4), genetlinl(4) to build
MFC after:	2 months
		(after 7366c0a49c)
2022-11-08 00:50:00 +08:00
Bjoern A. Zeeb
a62d5ff5b0 LinuxKPI: add linux/leds.h
This is just a dummy enum and struct in order to make drivers compile
more happily as some parts are simply not hidden behind #ifdefs and
this avoids a longer-term maintenance problem.

MFC after:	3 days
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D37215
2022-11-07 12:52:41 +00:00
Bjoern A. Zeeb
6e8d676131 LinuxKPI: add devm_request_irq()
Add devm_request_irq() needed by a driver.  Turns out all we need
is a wrapper with the right arguments to lkpi_request_irq().

MFC after:	3 days
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D37217
2022-11-07 12:51:01 +00:00
Bjoern A. Zeeb
6a647ae514 LinuxKPI: string.h implement memcpy_and_pad()
Add a memcpy variant which takes length of source and destination
buffers and a padding character in case there is free space in the
destination.  This is used by a wireless driver.

MFC after:	3 days
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D37226
2022-11-07 12:49:01 +00:00
Bjoern A. Zeeb
4a67f1df8b LinuxKPI: 802.11: enable WME support
Most of the WME code has been there disabled for months.  One of the
reasons was that it lead to crashes early on.  It is now understood
that the crashes are independent event and we can enable WME.
Update the code and deal with the calls from net80211 and adjust the
updates to when mac80211 drivers expect them, coherently put it under
LKPI_80211_WME and enable the define locally.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-11-07 12:39:46 +00:00
Johannes Totz
a9a35c9e35 re.4: Mention vendor driver for if_re(4)
If this if_re(4) is causing problems then an updated driver from
the vendor can be found in the ports tree under net/realtek-re-kmod.

Reviewed by:	debdrup, koobs, emaste
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D33677
2022-11-07 13:16:52 +01:00
Baptiste Daroussin
4d184bd438 RELNOTES: document the switch from sendmail to dma 2022-11-07 12:52:20 +01:00