Commit Graph
2042 Commits
Author SHA1 Message Date
Marco Trevisan (Treviño) f3d17a24f9 egis_etu905: Decouple SSM and command data from device
While most of commands should run separated, others such as cancellation
can run concurrently so we cannot share command data in the device
structure, but it has to be rather per command.

Move it there
2026-07-24 10:54:02 +00:00
Marco Trevisan (Treviño) ffdb0a84b8 ci/build: Use meson compile rather than ninja 2026-07-24 10:44:26 +00:00
Marco Trevisan (Treviño) 1b9bee4b6d build: Use run_target for sync-udev-hwdb 2026-07-24 10:44:26 +00:00
Marco Trevisan (Treviño) c890325589 build: Add dist check script that checks if there are unsupported devices 2026-07-24 10:44:26 +00:00
Marco Trevisan (Treviño) 5113f7ec3b ci: Use sync unsupported devices tool to check for diffs 2026-07-24 10:44:26 +00:00
Marco Trevisan (Treviño) b72feabc58 build: Add script to update the unsupported devices from wiki
Avoid some more manual labor
2026-07-24 10:44:26 +00:00
Marco Trevisan (Treviño) 833d39ab59 aes2550: Complete deactivation from dev_deactivate on broken loops
The driver relied on a running finger-detection or capture callback to
observe the deactivating flag and call complete_deactivation(). When the
async loop was broken by a session error from a terminal callback (such
as capture_sm_complete), no further iteration was left to notice the
flag, so the deactivation never completed.

Rather than scatter complete_deactivation() calls after every
fpi_image_device_session_error(), track whether an operation is actually
pending with an "active" flag and let dev_deactivate() complete the
request itself when nothing is in flight.

This keeps the deactivation lifecycle owned by dev_deactivate.
2026-07-23 14:36:02 +02:00
Marco Trevisan (Treviño)andShengyu Qu 87a7023831 aes2550: Add basic test to check too-short errors
Traces provided by Shengyu Qu

Co-Authored-By: Shengyu Qu <wiagn@4d2.org>
2026-07-23 14:36:02 +02:00
Marco Trevisan (Treviño) 44f3bbc43a build: Allow to run umockdev tests separately 2026-07-23 14:36:02 +02:00
Marco Trevisan (Treviño) fc9fd638a8 tests/umocdev-test: Allow to run just one test at time 2026-07-23 14:36:02 +02:00
Marco Trevisan (Treviño) c02d58a369 tests/create-driver-test: Use argparse and allow to record only one case 2026-07-23 14:36:02 +02:00
Marco Trevisan (Treviño) 71cff7966e tests/create-driver-tests.py: Allow to create both capture and custom tests
A device may provide both tests, so let's make this easier to achieve
2026-07-23 13:08:54 +02:00
Shengyu Qu 56516db045 tests: Add aes2550 driver replay test
Signed-off-by: Shengyu Qu <wiagn@4d2.org>
2026-07-23 18:40:35 +08:00
Shengyu Qu 20debe2ee4 drivers: aes2550: handle tapping without swiping
When tapping on the sensor rather than swiping through it, super RSR will
drop slices with 0-3 pixels of Y motion. In such case, self->strips_len is
zero and causing protocol error. Handle such cases by calling for a re-scan.

Closes: https://gitlab.freedesktop.org/libfprint/libfprint/-/work_items/786
Assisted-by: DeepSeek:deepseek-v4-pro-preview
Signed-off-by: Shengyu Qu <wiagn@4d2.org>
2026-07-21 21:57:50 +08:00
Shengyu Qu 56edcf7802 drivers: aes2550: fix lacking deactivation callback
In some cases, the driver generates error, but complete_deactivation() is not
called after calling fpi_image_device_session_error(). In this case, fprintd
would be waiting for fpi_image_device_deactivate_complete() forever. Fix by
adding calls for complete_deactivation();

Closes: https://gitlab.freedesktop.org/libfprint/libfprint/-/work_items/786
Assisted-by: DeepSeek:deepseek-v4-pro-preview
Signed-off-by: Shengyu Qu <wiagn@4d2.org>
2026-07-21 21:53:51 +08:00
Vincent Huang ecb975052d synaptics: add new PIDs 0x10D 0x10E 2026-07-15 11:38:54 +08:00
Marco Trevisan (Treviño) 6df065c399 Revert "fpi-print: Add function to check if two prints match"
This reverts commit b4d78e7c0f.
2026-07-13 12:10:21 +02:00
Marco Trevisan (Treviño) 323d8c3f85 fpi-device: Do not check for scanned prints equalty on NBIS prints
We cannot assume that two NBIS prints are matching without going through
proper NBIS checks, so we cannot do a check on the scanned print without
an extra thread, which is rather an overkill.

So let's just do the check for prints we can actually compare (raw ones
for now)
2026-07-13 12:09:36 +02:00
Marco Trevisan (Treviño) 73f641344b fpi-print: Expose a method to get the internal print type
We could use the property, but a getter is handier to use
2026-07-13 12:09:35 +02:00
Marco Trevisan (Treviño) 0abe22bd94 virtual-image: Do print enroll and verification using transformed images
We used to enroll and verify always the same prints, which made
generating the very same enrolled prints, that simplifies the libfprint
matching.

To make this a bit more real, let's apply some transformations to the
print images before sending them each time
2026-07-13 11:24:10 +02:00
Marco Trevisan (Treviño) 973aa65d4c vfs301: Handle unexpected data length gracefully 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 7f9504afd5 vfs301: Fix error handling on peeking events 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 98891dc042 vfs301: Handle a read failure as a protocol error 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) ba6f87584a vfs101: Prevent a division by zero 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 62c8554dac vfs101: Fix an use-after-free issue 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 2aa415f233 upekts: Validate inner length value before using it 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 5ccf66dd2c realtek: Do not check for negative values for gsize 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 873bca59ee realtek: Consider any non-success status as a failure during enroll 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 0a446df6f9 realtek: Handle missing missing or invalid templates as errors 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 2a4e68d64a elanmoc: Do not pass NULL error to SSM mark failed
The error has been already checked and it's null here, so we need to
return a new error
2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 2dee163512 elan: Prevent division by zero 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) db316a59f4 elan: Use safer check on linear frame processing 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 0ca34709cd egismoc: Add bounds check to validate responses 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) c30f767887 aesx660: Ignore oversized payloads 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 215974f211 aesx660: Fix strips leak 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) b04c11963e aes2510: Fix strips leak 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) c3244f38dc aes1610: Fix strips memory leak 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 791d17e4c3 synaptics: Do not trust device's enrolled fingers if it leads to an overflow
The device may report a number of enrolled fingers but this value is not
checked against the data, so let's do it to prevent an overflow

Reported by: Keith Linneman (LinnemanLabs)
2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) da497eed89 synaptics: Bound device-supplied lengths when parsing messages
The message parser trusted the device-supplied payload length without
checking it against the number of bytes actually received.

A malicious or malfunctioning reader could thus drive an out-of-bounds
read past the received buffer.

Reject a header whose declared payload would extend past the received
data (and a too-short header).

Reported by: Keith Linneman (LinnemanLabs)
2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) ecbc2affb2 upektc_img: Cleanup image bits on deactivation
Also ensure we never leak data
2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 44dd97bf5e upektc_img: Prevent image frame overflow
The frame length and the offset (which depends on the device-supplied
frame type) are derived from device bytes, so validate both the source
read (against the response buffer) and the destination write (against
the image buffer) before copying.
A malicious or malfunctioning device could otherwise drive a negative
(huge once unsigned) or out-of-bounds length.

Note: the response is reassembled across several USB transfers, so the
bound here is the response buffer capacity rather than a single
transfer's actual_length.

Reported by: Keith Linneman (LinnemanLabs)
2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 07152e43ef realtek: Fail on shorter data read that may lead to an underflow
Reported by: Keith Linneman (LinnemanLabs)
2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 2e2ba8b227 uru4000: Unset allocated data on completion 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 657c764b73 uru4000: Ensure we do not overflow image buffer on reading
Reported by: Keith Linneman (LinnemanLabs)
2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) ad8a6f6b17 uru4000: Prevent a buffer overflow on reading the device image data
num_lines comes from the device for each block and is summed into
the source row index (r) and destination byte offset (to).
Neither the per-block value nor the running totals are otherwise bound,
so a malicious device could drive the copy past the source
(IMAGE_HEIGHT rows) or destination buffer.

Reported by: Keith Linneman (LinnemanLabs)
2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 63be3884d6 etes603: Handle buffer over/under-flows
Reported by: Keith Linneman (LinnemanLabs)
2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) c025abcd15 fpc: Prevent overflow when reading the print identity
Reported by: Keith Linneman (LinnemanLabs)
2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 3cc0ae79e7 fpc: Prevent a buffer-overflow on data reading
Reported by: Keith Linneman (LinnemanLabs)
2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 092c0dfc31 fpcmoc: Copy the error before sending to the SSM
The SSM error is stolen and then we pass to the resume/suspend callback
potentially leading to a double-free.

So copy it before re-using it.

Reported by: Keith Linneman (LinnemanLabs)
2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 3138ad0c8a goodixmoc: Cleanup the byte reader usage 2026-07-13 08:13:46 +00:00