stdio: Fix negated wchar scansets
We were recording the start of the scanset before checking if it began
with a caret. We need to check for a caret first, then record whatever
comes next as the start of the scanset.
Note that scanf() did not have this bug, only wscanf(), but this adds
regression tests for both anyway.
MFC after: 1 week
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D62328
(cherry picked from commit 71c723518d22b2ae9c9c7819aa2625af3532bba5)
stdio: Fix typo in scanset test
Fixes: 71c723518d22 ("stdio: Fix negated wchar scansets")
(cherry picked from commit c5917853354369d9537c5a5aee4f0d2854325ed4)
stdio: Handle unterminated scansets
In both vfscanf() and vfwscanf(), if the end of the format string was
reached before the closing bracket of a scanset, we treated the NUL as
the closing bracket and continued to read beyond the end of the format
string. Add an error check to catch this case.
MFC after: 1 week
Reported by: Nick L. Leppelmeier <nicklpmr at gmail.com>
Reviewed by: kevans, emaste
Differential Revision: https://reviews.freebsd.org/D62199
(cherry picked from commit c5e0899d9908da5935cfaaade073d6911880fcb5)
stdio: Add test cases for scansets
Add test cases that exercise scanf() / wscanf() scansets, including
hyphenated ranges and the missing closing bracket bug we recently fixed.
MFC after: 1 week
Reviewed by: kevans, emaste
Differential Revision: https://reviews.freebsd.org/D62201
(cherry picked from commit c24ab9f32d9bb63b426f346cb5f28c00e63922c2)
stdio: Implement ranges for wchar scansets
The C and POSIX standards allow but do not require hyphenated ranges to
be supported in scanf() / wscanf() scansets. We implemented them for
scanf() but not for wscanf(). Do so using similar logic as for scanf().
This is hard to do efficiently for wide characters, which can in theory
span the full 32-bit range (and even the actual range of about 1 million
Unicode codepoints is difficult to handle), so we don't try to be
efficient, but just focus on producing the same results for wscanf() as
for scanf().
MFC after: 1 week
Reviewed by: kevans, emaste
Differential Revision: https://reviews.freebsd.org/D62200
(cherry picked from commit 50eb68efcb473c8c20c016d618a8cd674d3706dc)
stdio: Use correct comparison function
[2 lines not shown]
stdio: Fix negated wchar scansets
We were recording the start of the scanset before checking if it began
with a caret. We need to check for a caret first, then record whatever
comes next as the start of the scanset.
Note that scanf() did not have this bug, only wscanf(), but this adds
regression tests for both anyway.
MFC after: 1 week
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D62328
(cherry picked from commit 71c723518d22b2ae9c9c7819aa2625af3532bba5)
stdio: Fix typo in scanset test
Fixes: 71c723518d22 ("stdio: Fix negated wchar scansets")
(cherry picked from commit c5917853354369d9537c5a5aee4f0d2854325ed4)
stdio: Implement ranges for wchar scansets
The C and POSIX standards allow but do not require hyphenated ranges to
be supported in scanf() / wscanf() scansets. We implemented them for
scanf() but not for wscanf(). Do so using similar logic as for scanf().
This is hard to do efficiently for wide characters, which can in theory
span the full 32-bit range (and even the actual range of about 1 million
Unicode codepoints is difficult to handle), so we don't try to be
efficient, but just focus on producing the same results for wscanf() as
for scanf().
MFC after: 1 week
Reviewed by: kevans, emaste
Differential Revision: https://reviews.freebsd.org/D62200
(cherry picked from commit 50eb68efcb473c8c20c016d618a8cd674d3706dc)
stdio: Use correct comparison function
[2 lines not shown]
stdio: Handle unterminated scansets
In both vfscanf() and vfwscanf(), if the end of the format string was
reached before the closing bracket of a scanset, we treated the NUL as
the closing bracket and continued to read beyond the end of the format
string. Add an error check to catch this case.
MFC after: 1 week
Reported by: Nick L. Leppelmeier <nicklpmr at gmail.com>
Reviewed by: kevans, emaste
Differential Revision: https://reviews.freebsd.org/D62199
(cherry picked from commit c5e0899d9908da5935cfaaade073d6911880fcb5)
stdio: Add test cases for scansets
Add test cases that exercise scanf() / wscanf() scansets, including
hyphenated ranges and the missing closing bracket bug we recently fixed.
MFC after: 1 week
Reviewed by: kevans, emaste
Differential Revision: https://reviews.freebsd.org/D62201
(cherry picked from commit c24ab9f32d9bb63b426f346cb5f28c00e63922c2)
apex: add a driver for the Google Apex Edge TPU
The Apex is the accelerator on Coral PCI Express and M.2 modules,
appearing as 1ac1:089a
Google's Linux driver left staging in 5.16 and the out of tree
repository was archived; no BSD has had one.
Tested on: amd64, Coral M.2 Accelerator, running MobileNet v1
with the TensorFlow Lite 2.16 and LiteRT runtimes
Reviewed by: ziaee, adrian
Differential Revision: https://reviews.freebsd.org/D58563
gasket: add a framework for Google accelerator ASICs
Gasket is Google's name for the layer their accelerator drivers share:
Google ASIC Software, Kernel Extensions, and Tools. The chips differ,
but they present the same shape to the host. A control register BAR
with a few windows user space may map, an on-chip page table the host
fills in so the device can reach host memory, and a block of MSI-X
vectors.
Reviewed by: ziaee, adrian
Differential Revision: https://reviews.freebsd.org/D58561
print/ql570: New port
This program prints monochrome PNG files
on the Brother QL-570 and QL-700 thermal sticker printer
by writing to the USB device file (e.g. /dev/ulpt0).
bhyve: disable SIGPIPE for vtcons
Currently, if a virtio-console socket client closes the connection or
shuts down the read side, the next guest write to the socket
raises SIGPIPE and kills the VM.
Set SO_NOSIGPIPE on this socket to prevent that.
Reviewed by: markj
Fixes: 13ee8dde0409 ("Add virtio-console support to bhyve.")
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D62216
(cherry picked from commit 293dac30b9955d64cff74f3d31138950cc6bfafe)
linux: Fix handling of an empty argv
proc_getargv() can return an sbuf with length zero. In the Linux
note_prpsinfo() handler, this would cause "len" to underflow to -2,
resulting in a giant out-of-bounds memchr() loop.
There is no reason to subtract anything from the sbuf length to begin
with, the nul terminator is not included there. Simplify the code to
fix this bug, and modify the native note handler to match.
Reported by: Laam Alif at Ibteda Digital Library
Fixes: 00d17cf342cd ("elf_note_prpsinfo: handle more failures from proc_getargv()")
Reviewed by: des, kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D62449
bhyve: disable SIGPIPE for TCP uart backend
Currently, if a TCP uart client disconnects while the guest is writing
to the serial port, a subsequent write to the socket raises SIGPIPE and
kills the VM.
Set SO_NOSIGPIPE on the listening socket to prevent that. Accepted
connections inherit it.
Reviewed by: markj
Fixes: 1f903953fbf8 ("bhyve: Add raw tcp to uart backend")
MFC after: 3 days
MFC to: stable/15
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D62215
(cherry picked from commit cbfe766aac6f316007438c9f5557dd0c99bcbad3)
bhyve: disable SIGPIPE for vtcons
Currently, if a virtio-console socket client closes the connection or
shuts down the read side, the next guest write to the socket
raises SIGPIPE and kills the VM.
Set SO_NOSIGPIPE on this socket to prevent that.
Reviewed by: markj
Fixes: 13ee8dde0409 ("Add virtio-console support to bhyve.")
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D62216
(cherry picked from commit 293dac30b9955d64cff74f3d31138950cc6bfafe)
emulators/vita3k: Restrict to aarch64 and amd64
Fails to build on i386 with "error: invalid argument type 'uint128' to
unary expression" message.
Reported by: pkg-fallout
Approved by: arrowd (co-mentor)
lang/dotnet: Teach .NET about OpenSSL 3.5 on FreeBSD 15+
Not bumping PORTREVISION yet because bootstraps need to be re-rolled for this
change to take effect.
PR: 301034