llvm: remove Mips target support
The Mips architecture has been removed from all supported branches now.
MFC after: 1 week
(cherry picked from commit b5d1e0c5a4929e2be3bc58aad8e5b707860ec0fd)
llvm: remove Mips target support
The Mips architecture has been removed from all supported branches now.
MFC after: 1 week
(cherry picked from commit b5d1e0c5a4929e2be3bc58aad8e5b707860ec0fd)
stress2: Fix script bugs in gnop6.sh, gnop7.sh and fdatasync*.sh
gnop6.sh recorded the checkfs result with "checkfs ... || s=1 && s=0",
which the shell parses as "(checkfs || s=1) && s=0", so the test passed
even when the file system check failed.
gnop7.sh only sets s when unmount or fsck_ffs fails and ends with
"exit $s". On a clean run s is unset, and the script exits with the
status of the preceding "[ $notloaded ] && gnop unload", which is 1
whenever geom_nop was already loaded, for instance by an earlier test.
fdatasync.sh and fdatasync2.sh ran "df -i $RUNDIR" before creating the
directory. With a RUNDIR that does not exist yet, df failed, the test
printed "[: -lt: unexpected operator" and the free inode check was
skipped.
Reviewed by: pho
Differential Revision: https://reviews.freebsd.org/D60136
Sponsored by: Sippy Software, Inc.
MFC after: 2 weeks
tests/sys/vfs: Fix the Linux kld check
linux and linux64 are file names, not module names. The corresponding
module names are linuxelf and linux64elf, respectively, so these tests
were always being skipped.
Fixes: b98d169d1f91 ("tests/sys/vfs: add ABI-root absolute symlink tests")
Sponsored by: The FreeBSD Foundation
lockf: Do not block in vfs_busy()
A race is possible otherwise: vfs_busy() may return after an unmounted
filesystem has been removed from the global mount list. That is,
vfs_busy() will block until vfs_mount_destroy() sets MNTK_REFEXPIRE, and
at that point the mountpoint has been removed from the mountlist, so
TAILQ_FOREACH can return an invalid value.
Simply do not block if the mountpoint is being unmounted.
Reviewed by: kib
Fixes: eca39864f702 ("Add sysctl KERN_LOCKF")
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59982
(cherry picked from commit dd16a5f53b0b2e967d20d2900f18fc320997679b)
lockf: Do not block in vfs_busy()
A race is possible otherwise: vfs_busy() may return after an unmounted
filesystem has been removed from the global mount list. That is,
vfs_busy() will block until vfs_mount_destroy() sets MNTK_REFEXPIRE, and
at that point the mountpoint has been removed from the mountlist, so
TAILQ_FOREACH can return an invalid value.
Simply do not block if the mountpoint is being unmounted.
Reviewed by: kib
Fixes: eca39864f702 ("Add sysctl KERN_LOCKF")
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59982
(cherry picked from commit dd16a5f53b0b2e967d20d2900f18fc320997679b)
vm_page: Fix the error path in vm_page_alloc_contig_domain()
If we are inserting a run of pages into a VM object and fail at some
point due to a memory allocation failure, we have to free all of the
pages in the run. We do that by resetting some fields and calling
vm_page_free_toq() on each page; this removes the page from the object
and frees it back to the buddy allocator.
If the page is supposed to be wired, we reset the reference count, but
this was done incorrectly: the VPRC_OBJREF flag must be retained as the
page still belongs to an object. Resetting it to zero will cause a
panic in vm_page_free_prep(): vm_page_free_object_prep() will subtract
VPRC_OBJREF from the refcount, causing underflow, and
vm_page_free_prep() subsequently calls panic() if the refcount is
non-zero.
Reviewed by: alc, kib
Fixes: fee2a2fa3983 ("Change synchonization rules for vm_page reference counting.")
MFC after: 1 week
[4 lines not shown]
mac_bsdextended: reject negative rule indices in sysctl_rule()
The security.mac.bsdextended.rules.<N> node handler takes N as
`index = name[0]` (a signed int) and only checks
`index >= MAC_BSDEXTENDED_MAXRULES`. A negative index is caught on
the read branch, but the write-only add and delete
branches proceed to `rules[index]` unconditionally.
Reject `index < 0` alongside the existing upper-bound check.
Submitted by calif.io for the OpenAI Patch The Planet program
Signed-off-by: Andrew Griffiths <andrew at calif.io>
Reviewed by: markj
MFC after: 2 weeks
(cherry picked from commit 5d0b87669a91244e330a35fc973e6c60f92f6d1f)
ppp: Fix address leaks
Avoid printing timer addresses, so as to not divulge information about
the address space layout.
In ip.c, print the actual SPI instead of a pointer to the SPI in the
header buffer.
When debug logging is enabled, don't leak pointers when logging function
arguments or return values.
Reported by: Reo Shiseki
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
(cherry picked from commit c91777f23a3b13649cdf303515ee45a04c788af3)
vm_page: Fix the error path in vm_page_alloc_contig_domain()
If we are inserting a run of pages into a VM object and fail at some
point due to a memory allocation failure, we have to free all of the
pages in the run. We do that by resetting some fields and calling
vm_page_free_toq() on each page; this removes the page from the object
and frees it back to the buddy allocator.
If the page is supposed to be wired, we reset the reference count, but
this was done incorrectly: the VPRC_OBJREF flag must be retained as the
page still belongs to an object. Resetting it to zero will cause a
panic in vm_page_free_prep(): vm_page_free_object_prep() will subtract
VPRC_OBJREF from the refcount, causing underflow, and
vm_page_free_prep() subsequently calls panic() if the refcount is
non-zero.
Reviewed by: alc, kib
Fixes: fee2a2fa3983 ("Change synchonization rules for vm_page reference counting.")
MFC after: 1 week
[4 lines not shown]
ppp: Fix address leaks
Avoid printing timer addresses, so as to not divulge information about
the address space layout.
In ip.c, print the actual SPI instead of a pointer to the SPI in the
header buffer.
When debug logging is enabled, don't leak pointers when logging function
arguments or return values.
Reported by: Reo Shiseki
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
(cherry picked from commit c91777f23a3b13649cdf303515ee45a04c788af3)
posixshm: Fix a double unlock in shm_partial_page_invalidate()
For some reason, shm_partial_page_invalidate() unlocks the object upon
an error, but its callers don't expect this. Don't do any special error
handling. Keep the subroutine anyway since the name is a bit clearer
than vm_page_grab_zero_partial().
While here, normalize the object pointer used for locking in
shm_deallocate().
Reviewed by: kib
Fixes: 454bc887f250 ("uipc_shm: Implements fspacectl(2) support")
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59877
(cherry picked from commit ba974faaf30b74472acc4f0dc5853a22d43951f2)
mac_bsdextended: reject negative rule indices in sysctl_rule()
The security.mac.bsdextended.rules.<N> node handler takes N as
`index = name[0]` (a signed int) and only checks
`index >= MAC_BSDEXTENDED_MAXRULES`. A negative index is caught on
the read branch, but the write-only add and delete
branches proceed to `rules[index]` unconditionally.
Reject `index < 0` alongside the existing upper-bound check.
Submitted by calif.io for the OpenAI Patch The Planet program
Signed-off-by: Andrew Griffiths <andrew at calif.io>
Reviewed by: markj
MFC after: 2 weeks
(cherry picked from commit 5d0b87669a91244e330a35fc973e6c60f92f6d1f)
Merge commit 80e8c0a59189 from llvm-project (by ShengYi Hung):
[DebugInfo] Fill Column 0 if Line is not found (#227559)
It is possible that user specified line 0 as the start of the line in C
language (using `# 0`). However, it is rejected by the Lexer as we have
no line but still carries column information. As a result, we fill
column to 0 if we cannot find line.
Assisted-by: Claude # Test
Fixes: #56186
This fixes a fatal error when building the textproc/peg port.
PR: 264853
MFC after: 3 days
nd6: Fix regeneration of temp addresses in detached state
When an on-link prefix becomes detached, the kernel keeps
generating new RFC 8981 temporary addresses for that prefix.
Fix it by ignoring the detached addresses in regen_tmpaddr().
While here, change its return type to bool.
PR: 298533
Discussed with: markj
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D60051
(cherry picked from commit 61f98a98250da7bd2c80c6d93d0032961d7f2fad)
pf: return per-address feedback from netlink table test
The PFNL_CMD_TABLE_TEST_ADDRS reply carries only the match count, so
the per-address feedback from pfr_tst_addrs() is lost:
"pfctl -v -T test" lists nothing and "pfctl -vv -T test" reports
every address as "nomatch".
Return each address, as updated by pfr_tst_addrs(), in a nested
PF_TAS_ADDR attribute, and decode them into the caller's array in
libpfctl. PF_TA_ADDR is not reused: it shares its value with
PF_TAS_ASTATS, which older libpfctl would decode into an
uninitialised target. That target was also read when no reply was
parsed, so the match count could be garbage; initialise it.
Add a regression test.
Reviewed by: kp
Approved by: kp (mentor)
Fixes: 281282e9357b ("pf: convert DIOCRTSTADDRS to netlink")
[3 lines not shown]
pf: remove a source limiter from the id tree if its name is taken
When pf_sourcelim_add() finds the name of the new limiter taken, it
undoes the insertion into the id tree with RB_REMOVE() on the name tree,
which the limiter is not in, and then frees the limiter. The freed
limiter stays in the inactive id tree, and RB_REMOVE() of an element
with no links clears the root of the name tree, which loses every other
inactive limiter from it. pf_statelim_add() gets this right.
parse.y refuses duplicate names, so pfctl does not get here, but any
netlink client can.
Reviewed by: kp
Approved by: kp (mentor)
Fixes: 461648121230 ("pf: introduce source and state limiters")
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D60189
pf: free the packet rate counter of a rule
pf_ioctl_addrule() allocates a counter_rate for every rule, whether it
has a max-pkt-rate or not, and pf_krule_free() never frees it.
Free it with the rest of the rule.
Reviewed by: kp
Approved by: kp (mentor)
Fixes: ff11f1c8c76c ("pf: add a generic packet rate matching filter")
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D60190
man: Link ena.4 to if_ena.4
For consistency, create a symbolic link from ena.4 to also if_ena.4
Reviewed by: #manpages, ziaee
Differential Revision: https://reviews.freebsd.org/D60191
MFC after: 3 days
ifuncs: Have DEFINE_*IFUNC() macros expand the passed name
While here, make each <machine/ifunc.h> header include <sys/types.h> so
that it can be included standalone.
Reviewed by: kib
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60167
llan: byte swap the receive queue entries
The receive queue of a PAPR logical LAN is filled in by the hypervisor, so
its fields are big endian, but llan_intr() read the offset and the length of
each frame natively. On a little endian kernel the length of a 134 byte
frame reads as 0x86000000, and ether_input() discards the mbuf because m_len
is not even large enough for an ethernet header. No frame is ever received.
Reproduced on a POWER9 pseries guest with a spapr-vlan interface. Before:
llan0: discard frame w/o leading ethernet header (len -2046820352
pkt len -2046820352)
llan0 1500 <Link#1> 52:54:00:12:34:56 123 118 0 5838733312 7 0
that is 118 input errors out of 123 packets, dhclient(8) never completes and
ping(8) loses every packet, although transmit works because the transmit
path passes the lengths in hcall registers rather than through memory.
Afterwards the interface gets a DHCP lease and ping reports no loss.
[5 lines not shown]