pci: restore resizable BAR sizes in pci_cfg_restore()
After a device reset, resizable BARs return to their default sizes.
Restore them to the sizes they had prior to reset.
Reviewed by: imp, adrian
Differential Revision: https://reviews.freebsd.org/D61110
Approved by: adrian (mentor)
Signed-off-by: Nick Price <nprice at FreeBSD.org>
ppp: bound Predictor-1 decompression output
Pred1Input() decompressed CCP data into a MAX_MRU+2 mbuf with no limit
on the output, so a peer could expand a short compressed frame (up to
8:1) past the buffer and overflow adjacent heap. An input length below
4 also drove decompress() with a negative length.
Reject out-of-range input lengths and stop decompression at the
destination buffer size.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D61011
Approved by: adrian (mentor)
Signed-off-by: Nick Price <nprice at FreeBSD.org>
ppp: drop config packets whose options overrun the packet
fsm_readopt() advanced the decode cursor by the option length without
checking it against the end of the packet. A crafted LCP/CCP/IPCP
option could then make the Config-Reject/Nak echo copy past the
received packet into adjacent heap, disclosing heap bytes to the peer
before authentication.
Check the option framing once in fsm_Input() and drop the packet before
decoding per RFC1661
Reviewed by: adrian, markj
Differential Revision: https://reviews.freebsd.org/D61008
Approved by: adrian (mentor)
Signed-off-by: Nick Price <nprice at FreeBSD.org>
linux: do not truncate the listxattr() size
listxattr() sized its buffer with min(), which truncates the 64-bit
size to 32 bits, so a size of 2^32 + k allocated k bytes while the
copy-out guard used the full size. The walk then read record lengths
past the buffer and copied kernel heap out to the caller, and could
panic the kernel. Any user can reach it through a user.* attribute on
a file it owns.
Use MIN(), and fail with EIO if a record runs past the data returned.
Reviewed by: adrian, markj
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D61006
Signed-off-by: Nick Price <nprice at FreeBSD.org>
devel/gerrit: add new port for Gerrit Code Review 3.14.2
Gerrit is a free, web-based code collaboration tool for Git-based
projects. It provides code review, repository management, and an
integrated SSH server for git operations.
This port installs the pre-built WAR file with an RC script for
running Gerrit as a daemon.
WWW: https://www.gerritcodereview.com/
[libc] Use a syscall wrapper for remap_file_pages
This PR move remap_file_pages behind the centralized syscall wrappers, following libc/docs/dev/syscall_wrapper_refactor.md.
[libc] Use a syscall wrapper for posix_madvise
This PR move posix_madvise behind the centralized syscall wrappers, following libc/docs/dev/syscall_wrapper_refactor.md.
[VPlan] Factor out VPSCEVExpander::canExpandInIR (NFC). (#240063)
Split off the check for expressions that are expanded in IR and hoisted
out of HoistOutOf, to reuse it in follow-ups.
[LV] Remove InnerLoopVectorizer (NFC) (#240055)
All that is left of InnerLoopVectorizer is a bundle of state passed to
executePlan, of which only the assumption cache, a fresh IRBuilder and
whether runtime checks were generated are used, plus fixVectorizedLoop,
which runs legacyCSE on the vector loop header.
Create the IRBuilder in executePlan, take the assumption cache from
Legal, pass whether there are runtime checks as a bool and run legacyCSE
directly. Also drop executePlan's DominatorTree argument, which is the
same as the planner's DT member, and update comments that still refer to
InnerLoopVectorizer.
PR: https://github.com/llvm/llvm-project/pull/240055
[KnownFPClass][NFC] Move fma logic out of fadd_impl, and document rounding mode assumption made by fadd/fsub (#240054)
I have plans to improve deductions made by `fadd`/`fsub` and `fma`.
However, some of these deductions are only valid for `fadd`/`fsub`, so I
have moved the `fma` logic outside of `fadd_impl` and into its own
`fma_impl` function. This allows us to make improvements to `fadd/fsub`
independently of `fma`, and it also makes it easier to audit
improvements to `fma`.
I also have plans to support the rounding mode for primitive arithmetic
functions https://github.com/llvm/llvm-project/issues/228974, so I have
documented the `NearestTiesToEven` assumption that `fadd_impl` makes
when ruling out `-0.0`, allowing `fadd_impl` to be valid for all
rounding modes.
xdr: Limit xdr_wrapstring
The previous commit (re)introduced the possibility that a malicious or
corrupt message can cause the receiver to allocate a very large amount
of memory before realizing that the message is much shorter than
claimed. Revert the change to xdr_wrapstring() to avoid this.
Fixes: d2018cedb414 ("xdr: Fix xdr_string")
Reported by: bjk@
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D60898
xdr: Limit xdr_wrapstring
The previous commit (re)introduced the possibility that a malicious or
corrupt message can cause the receiver to allocate a very large amount
of memory before realizing that the message is much shorter than
claimed. Revert the change to xdr_wrapstring() to avoid this.
Fixes: d2018cedb414 ("xdr: Fix xdr_string")
Reported by: bjk@
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D60898
iSCSI: Fast and per-session timeouts
Support per-session configurable ping (SCSI NOP) and login timeouts
similar to what is supported in the Linux iSCSI initiator configuration file.
Reduce iscsi timer granularity to 0.1 sec.
For backwards compatibility, when all timers are selected on integer numbers,
all status messages are unchanged. If the higher granularity is used, the
log messages include sub-second granularity.
The sysctl(3) interface has changed from pure int to string, in order to
support fractional seconds in a human-readable, dotted notation.
Reviewed By: #netapp, #manpages, jhb, pauamma_chezdork.com, siderop1_netapp.com
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D32540
iSCSI: Fast and per-session timeouts
Support per-session configurable ping (SCSI NOP) and login timeouts
similar to what is supported in the Linux iSCSI initiator configuration file.
Reduce iscsi timer granularity to 0.1 sec.
For backwards compatibility, when all timers are selected on integer numbers,
all status messages are unchanged. If the higher granularity is used, the
log messages include sub-second granularity.
The sysctl(3) interface has changed from pure int to string, in order to
support fractional seconds in a human-readable, dotted notation.
Reviewed By: #netapp, #manpages, jhb, pauamma_chezdork.com, siderop1_netapp.com
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D32540