Commit Graph
2072 Commits
Author SHA1 Message Date
Luan NguyenandMarco Trevisan 1f335cd58a goodixmoc: Update autosuspend hwdb for 27c6:6082 2026-09-01 08:24:38 +00:00
Luan NguyenandMarco Trevisan 2373a8f208 goodixmoc: Add support for Goodix 27c6:6082 2026-09-01 08:24:38 +00:00
Ge-org Brohammer dd0f15bf02 tests/realtek: Cover duplicate enrollment errors
Extend the 2541:fa03 storage-error fixture to enroll the same finger
twice and assert FP_DEVICE_ERROR_DATA_DUPLICATE, reusing the device
session the delete test already opened rather than starting a second
one. Compact redundant polling transactions while preserving the
recorded protocol state changes.
2026-09-01 09:55:22 +02:00
Ge-org Brohammer 629860c965 realtek: Report duplicate enrollment as DATA_DUPLICATE
When the sensor rejects an enrollment because the finger is already
present in on-chip storage, fp_check_duplicate_cb() raises
FP_DEVICE_ERROR_PROTO. That error class means "protocol error with the
device", which is not what happened; the device answered correctly.

The practical effect is that fprintd cannot classify the failure.
It already maps FP_DEVICE_ERROR_DATA_DUPLICATE to its "enroll-duplicate"
result, so with PROTO the user is shown "enroll-unknown-error" instead of
being told to try a different finger.

Use FP_DEVICE_ERROR_DATA_DUPLICATE, which exists for exactly this case.

Reproduced on a Realtek 2541:fa03 (Minisforum AI X1 Pro) by enrolling the
same finger twice:

  [realtek] SSM Enroll failed in state 5 with error:
            Current fingerprint is duplicate!
  Device reported enroll completion (print: (nil),
            error: [FP_DEVICE_ERROR_PROTO] Current fingerprint is duplicate!)
  fprintd: enroll_cb: result enroll-unknown-error
2026-08-31 17:46:55 +00:00
SbenazarandMarco Trevisan 3f1e2817ed tests/build: Iterate drivers_tests as a dict when skipping driver tests
bf91b0ed ("tests/build: Allow to define per-test parameters via a dict")
turned drivers_tests into a dict and updated the loop that defines the real
tests, but the fallback that only adds the skipping ones still asks for a
single iteration variable. Configuring with -Dintrospection=false stops right
there:

  tests/meson.build:295:25: ERROR: Foreach expects exactly 2 variables for
  iterating over objects of type dict

Hit it with meson 1.11 while building a single driver without introspection.
2026-08-29 23:01:47 +00:00
Ge-org Brohammer 3a41fa7ccc tests/realtek: Cover the storage error path that returned a freed GError
Deleting a print whose template is not in the sensor's storage makes the
driver fail its task SSM, which is the path that handed an already-freed
GError to fpi_device_delete_complete(). Reading the reported error is
therefore what the test is for.

No enrollment is involved: the test deserializes a stored realtek print
whose template is deliberately not on the device, so the recording needs
no finger presses and the capture stays at 90 packets.

Without the previous commit the test dies rather than fails:

  umockdev-run ... died with <Signals.SIGSEGV: 11>
  1/1 drivers+custom - libfprint:realtek-storage-errors FAIL

The duplicate-enrollment path reaches the same bug through
fp_enroll_ssm_done(), but capturing it needs two full enrollments and
some 1.07M packets of polling traffic, so it is left out here.
2026-08-28 15:19:30 +02:00
Ge-org Brohammer 26d38779e4 realtek: Fix use-after-free of the SSM error in completion handlers
fp_verify_ssm_done(), fp_enroll_ssm_done(), fp_init_ssm_done() and
fp_delete_ssm_done() each overwrite the GError they are given:

  if (fpi_ssm_get_error (ssm))
    error = fpi_ssm_get_error (ssm);

An SSM completion callback is handed an owned copy of the error --
fpi-ssm.c takes a g_error_copy() before invoking the callback -- whereas
fpi_ssm_get_error() is documented as (transfer none), and the machine's
own error is freed by the fpi_ssm_free() that immediately follows the
callback.

Since every fpi_device_*_complete() takes the error as (transfer full),
these handlers leak the copy they own and hand the consumer a pointer
that is freed moments later. The consumer is then left reading a
dangling GError. For fprintd that is fatal: it logs error->message and
dies with a general protection fault inside strlen(), taking the
session's authentication daemon with it.

  kernel: traps: fprintd[67901] general protection fault
                 ip:7fcef3b6429c sp:7ffd5f4128a8 error:0 in libc.so.6

  #0  __strlen_evex ()
  #3  g_vasprintf () at ../glib/gprintf.c:342
  #5  g_strdup_vprintf () at ../glib/gstrfuncs.c:515
  #9  delete_enrolled_fingers (user=... "ge-org",
                               finger=FP_FINGER_RIGHT_INDEX)
        at ../src/device.c:2420
        local_error = 0x563c2628bcb0

The assignment is redundant even where it is not harmful, because the
error passed to the callback is already a copy of the machine's error;
using it directly is both correct and sufficient. fpi_ssm_dup_error()
is available for callers that do need an owned copy. No other driver in
the tree assigns the borrowed SSM error this way.

Reproduced on a Realtek 2541:fa03 (Minisforum AI X1 Pro 470) by
enrolling a finger while a template was already present in on-chip
storage, which takes the delete path shown above. The same driver bug
reaches fprintd a second way, via fp_enroll_ssm_done() ->
fpi_device_enroll_complete() -> fprintd's enroll_cb().
2026-08-28 13:30:33 +02:00
jialei 83346fc8bc goodixmoc:Add pid 0x65BA, 0x6515, 0x66AC, 0x660A 2026-08-17 18:23:35 +08:00
Ken c4654fdc85 elanmoc: Add new PID 0xCB6 2026-07-28 11:28:20 +08:00
Marco Trevisan (Treviño) 80a4b5ec61 build: Release libfprint 1.94.100 v1.94.100 2026-07-26 00:36:25 +02:00
Marco Trevisan (Treviño) 5f49a0fa1f NEWS: Update for libfprint 1.94.100
A bigger micro version as we have enough changes, but not as many to do
a minor version bump yet, that is planned for next one.
2026-07-26 00:36:11 +02:00
Marco Trevisan (Treviño) facbb5f73b build: Bump meson dependency to 0.62 2026-07-26 00:33:46 +02:00
Marco Trevisan (Treviño) 1dd419de3e data, udev-hwdb: Sync unsupported devices with wiki 2026-07-26 00:33:46 +02:00
Marco Trevisan (Treviño) 77f9ad2df1 build: Make sync-udev-hwdb dependent on hwdb list re-generation 2026-07-26 00:24:36 +02:00
Jason HuangandMarco Trevisan 695663f30d egis_etu905: Fix identify cancel to report cancelled error correctly
task_ssm_done cleared task_ssm before calling maybe_cancel, so
identify_cancel_ssm_done couldn't tell whether the identify already
completed or was cancelled.  Use fpi_device_action_is_cancelled()
and skip the duplicate identify_complete call in IDENTIFY_COMPLETE
state when cancelled, letting the cancel flow handle completion.
2026-07-25 21:21:50 +00:00
Marco Trevisan (Treviño) a6240828c1 tests/egis_etu905: Actually test the device identify cancellation path 2026-07-25 21:21:50 +00:00
Jason HuangandMarco Trevisan 68aa38ed9d egis_etu905: Fix cancel operation to trigger template update 2026-07-25 21:21:50 +00:00
Marco Trevisan (Treviño) b8154bf466 egis_etu905: Handle cancel as part of the device SSM return
Cancelling an operation does allow the driver to do perform async ops
at the moment, but rather we are supposed to just send the the cancel
commands while another action may running.

So we should handle this as part of the SSM final stage, if cancellation
happened.
2026-07-25 21:21:50 +00:00
Marco Trevisan (Treviño) 4bc5213e08 egis_etu905: Split cancellable handling in commands
cancel command cannot be cancellable, while we want others to be, so
let's split the two cases, and handle them separately
2026-07-25 21:21:50 +00:00
Jason HuangandMarco Trevisan c45781cf17 egis_etu905: support template update after identify/verify
Add IDENTIFY_SEND_CANCEL_RESULT state to send cancel command
after identify/verify completes, triggering firmware template update.
Implement cancel() callback for enroll and identify/verify cancellation.
Updated umockdev test data to cover the new flow.
2026-07-25 21:21:50 +00:00
Jason HuangandMarco Trevisan 84a33b7d59 fpi-usb-transfer: Avoid hex dump on cancelled transfers
When a USB transfer is cancelled, actual_length is set to -1. This
gets implicitly cast to gsize (unsigned) in log_transfer(), resulting
in a huge length passed to fp_dbg_hex_dump_data() and causing a
segfault.

Only dump data when the length is within valid bounds.
2026-07-25 21:21:50 +00:00
Marco Trevisan (Treviño) de5d539b50 fpi-device: Use the error quark string to debug unknown error domains 2026-07-25 21:21:50 +00:00
Marco Trevisan (Treviño) 1b589a9245 fpi-device: Add more specific debug info for usb errors 2026-07-25 21:21:50 +00:00
Marco Trevisan (Treviño) 91012c3690 ci: Use ninja to generate coverage files
meson compile -C <build-dir> coverage is not a thing

See: https://github.com/mesonbuild/meson/issues/7895
2026-07-24 17:58:18 +02:00
Marco Trevisan (Treviño) 157ec7e544 fp-device: Add debug for task cancellation requests 2026-07-24 10:54:02 +00:00
Marco Trevisan (Treviño) d938dc0278 mafpmoc: Remove unused cancel vfunc 2026-07-24 10:54:02 +00:00
Marco Trevisan (Treviño) dcf37cf476 egismoc: Remove unneeded length definitions 2026-07-24 10:54:02 +00:00
Marco Trevisan (Treviño) ebb4b058b4 egis_etu905: Remove unneeded length definitions 2026-07-24 10:54:02 +00:00
Benjamin BergandMarco Trevisan 1a5fc6e4d5 egis_etu905: move commands into read-only memory
There is no need for them to be writable and with the previous commit
this change will also not result in any compiler warnings. Simply change
all of the static definitions to be static const.

Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net>
2026-07-24 10:54:02 +00:00
Benjamin BergandMarco Trevisan f5955e7cb5 egis_etu905: use const buffer for egis_etu905_exec_cmd command
The function only uses the passed command as a const buffer and makes a
copy immediately. As such, there is also no need for a destroy callback
as the caller can simply clean up afterwards.

Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net>
2026-07-24 10:54:02 +00:00
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