In search of contributors to a Linux Chromebook fingerprint PAM module

RO version:    bloonchipper_v2.0.5938-197506c1
RW version:    bloonchipper_v2.0.25729-0f6159b
RW cros fwid:  bloonchipper_15962.0.0
Firmware copy: RW
Build info:    bloonchipper_v2.0.25729-0f6159b boringssl:v0.0.8282-3e89a7e8d cryptoc:v1.9308_26_0.14-0dd6790 ec-private:v2.1.9999-0f6159b1 fpc:v2.1.9999-0f6159b1 bloonchipper_15962.0.0 2024-07-18 20:18:36 @chromeos-release-builder-us-central1-a-x32-16-2kmn
Tool version:  0.0.1-isolate Jun 23 2023 none

From my last post:

$ rust-fp match
Ready to match...
Output: NoMatch(Some(Other))
No match
Error matching: Other

I am sure I am missing something, so I am going over the process again, to make sure I haven’t. There are some differences in the file paths, of course but that is straightforward to figure out.

Can you also run sudo ectool console --name=cros_fp after NoMatch(Some(Other)) happens? Can you also run sudo ectool uptimeinfo --name=cros_fp?

NoMatch(Some(Other)) means that there was an error matching, and the error is Other

#[derive(Debug)]
pub enum EcMkbpEventFingerprintNoMatchError {
    /// `EC_MKBP_FP_ERR_MATCH_NO_INTERNAL` - Probably means there was an internal error.
    Internal,
    /// `EC_MKBP_FP_ERR_MATCH_NO_TEMPLATES` - This either means there are no templates, or something's wrong with the templates. Idk which one.
    Templates,
    /// `EC_MKBP_FP_ERR_MATCH_NO_LOW_QUALITY` - My guess is this might happen if the sensor or finger is dirty
    LowQuality,
    /// `EC_MKBP_FP_ERR_MATCH_NO_LOW_COVERAGE` - My guess is this might happen if only a small part of a finger is sensed
    LowCoverage,
}

It’s not a LowQuality error. My guess is that it is a Templates error, which probably means that no templates were uploaded to the FP sensor, which shouldn’t happen.

apturing ...]
[295204.827560 Capturing ...]
[295204.918962 Matching/4 ...]
bio_template_image_match_list - Template load failed. Result=-14
bio_template_image_match_list - Template delete failed for candidate 0. Result=-2
[295204.919190 Error: bio_template_image_match_list() failed, result=-14]
[295204.919295 Match =>-14 (finger 65535)]
[296263.731009 HC Suppressed: 0x97=246 0x98=0 0x113=0 0x103=0 0x115=0 0x2b=0 0x67=7 0x121=5]
[299863.956111 HC Suppressed: 0x97=351 0x98=0 0x113=0 0x103=0 0x115=0 0x2b=0 0x67=0 0x121=0]
[301621.190855 HC 0x0409]
[301621.191859 HC 0x0402]
[301633.508301 Capturing ...]
[301634.256292 Capturing ...]
[301634.353876 Matching/4 ...]
bio_template_image_match_list - Template load failed. Result=-14
bio_template_image_match_list - Template delete failed for candidate 0. Result=-2
[301634.354104 Error: bio_template_image_match_list() failed, result=-14]
[301634.354207 Match =>-14 (finger 65535)]
[301634.370185 HC 0x0409]
[301634.371277 HC 0x0402]
[301634.400844 Capturing ...]
[301634.492282 Matching/4 ...]
bio_template_image_match_list - Template load failed. Result=-14
bio_template_image_match_list - Template delete failed for candidate 0. Result=-2
[301634.492510 Error: bio_template_image_match_list() failed, result=-14]
[301634.492613 Match =>-14 (finger 65535)]
[301650.120183 HC 0x0002]
[301650.122457 HC 0x0007]
[301650.123530 HC 0x000b]
[301690.216085 HC 0x0402]
+[301690.217987 HC 0x000b]
[301690.218604 FPC libfpbep.a fpc_bep_chromebook_2.0.0.016]
[301690.218692 Build information - FPCBEP: sw11_fpc_bep_chromebook_2.0.0.016 (Oct  9 2019 13:59:40)]
[301690.218967 HC 0x0008]
[301690.219886 HC 0x0403]
[301690.363585 FPC1025 id 0x021f]
[301700.133570 HC 0x0002]
[301700.135849 HC 0x0007]
[301700.136904 HC 0x000b]
[301841.424515 HC 0x0002]
[301841.426614 HC 0x0007]
[301841.427614 HC 0x000b]
[301860.511351 HC 0x0002]
[301860.513239 HC 0x0007]
[301860.514208 HC 0x000b]
[301926.119072 HC 0x0002]
[301926.121178 HC 0x0007]
[301926.122157 HC 0x000b]
EC uptime: 302044.970 seconds
AP resets since EC boot: 0
Most recent AP reset causes:
EC reset flags at last EC boot: reset-pin | power-on | sysjump

If it helps any: after clearing and re-enrolling two fingers and matching the second one.

HC 0x0404]
+++(++)[302136.799528 HC 0x0409]
[302136.800626 HC 0x0402]
[302137.784081 Capturing ...]
[302137.875522 Matching/1 ...]
[302138.028995 Match =>3 (finger 0)]
[302138.042697 HC 0x0404]
+++(++)[302147.340604 HC 0x0409]
[302147.341809 HC 0x0402]
[302148.247301 Capturing ...]
[302148.765310 Capturing ...]
[302148.856740 [1]Enrolling ...]
[302148.991920 [1]Enroll =>0 (20%)]

### FPU exception at PC=0x0806a372 LR=0x0806a367 (task 2) ###
### FPSCR=0x20000011 => Invalid Operation Inexact ###
[302149.007460 HC 0x0409]
[302149.008784 HC 0x0402]
[302149.356048 Capturing ...]
[302149.447493 [1]Enrolling ...]
[302149.584856 [1]Enroll =>0 (40%)]

### FPU exception at PC=0x0806a372 LR=0x0806a367 (task 2) ###
### FPSCR=0x20000012 => Division By Zero Inexact ###
[302149.600144 HC 0x0409]
[302149.601379 HC 0x0402]
[302149.895452 Capturing ...]
[302149.986890 [1]Enrolling ...]
[302150.126986 [1]Enroll =>0 (60%)]

### FPU exception at PC=0x0806a372 LR=0x0806a367 (task 2) ###
### FPSCR=0x20000012 => Division By Zero Inexact ###
[302150.141877 HC 0x0409]
[302150.143008 HC 0x0402]
[302150.463960 Capturing ...]
[302150.555402 [1]Enrolling ...]
[302150.697286 [1]Enroll =>0 (80%)]

### FPU exception at PC=0x0806a372 LR=0x0806a367 (task 2) ###
### FPSCR=0x20000012 => Division By Zero Inexact ###
[302150.713158 HC 0x0409]
[302150.714314 HC 0x0402]
[302151.035182 Capturing ...]
[302151.126622 [1]Enrolling ...]
[302151.271339 [1]Enroll =>0 (100%)]
[302151.273559 Error: positive match secret already readable.]

### FPU exception at PC=0x0806a372 LR=0x0806a367 (task 2) ###
### FPSCR=0x20000012 => Division By Zero Inexact ###
[302151.286564 HC 0x0404]
+++(++)[302154.611258 HC 0x0409]
[302154.612378 HC 0x0402]
[302155.356543 Capturing ...]
[302155.800118 Capturing ...]
[302156.715077 Capturing ...]
[302156.806510 Matching/2 ...]
[302156.969575 Match =>3 (finger 1)]
[302156.983729 HC 0x0404]
+++(++)[302174.032569 HC 0x0002]
[302174.034566 HC 0x0007]
[302174.035610 HC 0x0

That’s interesting. It seems like for your Chromebook the FP sensor does not reboot when it is suspended. On my jinlon the FP sensor reboots every time it the Chromebook suspends.

I often pick the oddball hardware, it seems :smiley:

Is there a way to manually do that? I have no problem setting pre- and post- suspend actions with systemd if that works.

I don’t think it needs to be restarted. I will look at the code and see if any changes need to be made.

1 Like

@claydoh one more time when you get this error can you please send the output of:
systemctl status of the dbus-interface
sudo ectool --name=cros_fp console
sudo ectool --name=cros_fp fpinfo
sudo ectool --name=cros_fp fpstats
sudo ectool --name=cros_fp uptimeinfo

Oddly, I had no issues during suspends today, which happened at least 6 or 8 times, not counting doing so manually.

After a reboot:

~$ rust-fp match
Ready to match...
Output: NoMatch(Some(Other))
No match
Error matching: Other

~$ systemctl status  rust-fp-dbus-interface
● rust-fp-dbus-interface.service - Gives normal user access to enrolling and matching fingerprints
     Loaded: loaded (/etc/systemd/system/rust-fp-dbus-interface.service; enabled; preset: enabled)
     Active: active (running) since Wed 2024-11-06 18:54:46 AEDT; 4min 8s ago
   Main PID: 773 (rust-fp-dbus-in)
      Tasks: 12 (limit: 9259)
     Memory: 6.2M (peak: 7.0M)
        CPU: 23ms
     CGroup: /system.slice/rust-fp-dbus-interface.service
             └─773 /usr/local/bin/rust-fp-dbus-interface

Nov 06 18:57:49 kromey-book rust-fp-dbus-interface[773]: 2024-11-06T07:57:49.560Z TRACE [async_std::task::builder] spawn
Nov 06 18:57:49 kromey-book rust-fp-dbus-interface[773]: 2024-11-06T07:57:49.924Z WARN  [rust_fp_common::rust_fp_dbus] Got match output
Nov 06 18:57:49 kromey-book rust-fp-dbus-interface[773]: 2024-11-06T07:57:49.928Z WARN  [rust_fp_common::rust_fp_dbus] Matching
Nov 06 18:57:49 kromey-book rust-fp-dbus-interface[773]: Hashes: [17715610037096683468, 40791216995680470]. Loaded hashes: [17715610037096683468, 40791216995680470]
Nov 06 18:57:49 kromey-book rust-fp-dbus-interface[773]: 2024-11-06T07:57:49.933Z TRACE [async_std::task::builder] spawn
Nov 06 18:57:50 kromey-book rust-fp-dbus-interface[773]: 2024-11-06T07:57:50.065Z WARN  [rust_fp_common::rust_fp_dbus] Got match output
Nov 06 18:58:01 kromey-book rust-fp-dbus-interface[773]: 2024-11-06T07:58:01.838Z WARN  [rust_fp_common::rust_fp_dbus] Matching
Nov 06 18:58:01 kromey-book rust-fp-dbus-interface[773]: Hashes: [17715610037096683468, 40791216995680470]. Loaded hashes: [17715610037096683468, 40791216995680470]
Nov 06 18:58:01 kromey-book rust-fp-dbus-interface[773]: 2024-11-06T07:58:01.852Z TRACE [async_std::task::builder] spawn
Nov 06 18:58:02 kromey-book rust-fp-dbus-interface[773]: 2024-11-06T07:58:02.578Z WARN  [rust_fp_common::rust_fp_dbus] Got match output


$ sudo ./ectool --name=cros_fp console
[sudo] password
or candidate 0. Result=-2
[241.040456 Error: bio_template_image_match_list() failed, result=-14]
[241.040530 Match =>-14 (finger 65535)]
[241.060608 HC 0x0409]
[241.061911 HC 0x0402]
[241.090806 Capturing ...]
[241.182246 Matching/2 ...]
bio_template_image_match_list - Template load failed. Result=-14
bio_template_image_match_list - Template delete failed for candidate 0. Result=-2
[241.182448 Error: bio_template_image_match_list() failed, result=-14]
[241.182520 Match =>-14 (finger 65535)]
[241.203086 HC 0x0409]
[241.204405 HC 0x0402]
[241.233321 Capturing ...]
[241.324692 Matching/2 ...]
bio_template_image_match_list - Template load failed. Result=-14
bio_template_image_match_list - Template delete failed for candidate 0. Result=-2
[241.324892 Error: bio_template_image_match_list() failed, result=-14]
[241.324966 Match =>-14 (finger 65535)]
[241.345069 HC 0x0409]
[241.346383 HC 0x0402]
[241.607553 Capturing ...]
[241.698923 Matching/2 ...]
bio_template_image_match_list - Template load failed. Result=-14
bio_template_image_match_list - Template delete failed for candidate 0. Result=-2
[241.699123 Error: bio_template_image_match_list() failed, result=-14]
[241.699197 Match =>-14 (finger 65535)]
[241.718581 HC 0x0409]
[241.719827 HC 0x0402]
[241.748648 Capturing ...]
[241.840161 Matching/2 ...]
bio_template_image_match_list - Template load failed. Result=-14
bio_template_image_match_list - Template delete failed for candidate 0. Result=-2
[241.840361 Error: bio_template_image_match_list() failed, result=-14]
[241.840435 Match =>-14 (finger 65535)]
[253.662958 HC 0x0409]
[253.663779 HC 0x0402]
[254.288699 Capturing ...]
[254.380077 Matching/2 ...]
bio_template_image_match_list - Template load failed. Result=-14
bio_template_image_match_list - Template delete failed for candidate 0. Result=-2
[254.380277 Error: bio_template_image_match_list() failed, result=-14]
[254.380351 Match =>-14 (finger 65535)]
[376.282440 HC 0x0002]
[376.284067 HC 0x0007]
[376.284826 HC 0x000b]

~/Downloads$ sudo ./ectool --name=cros_fp fpinfo
Fingerprint sensor: vendor 20435046 product 9 model 21f version 1
Image: size 160x160 8 bpp
Error flags: 
Dead pixels: UNKNOWN
Templates: version 4 size 5156 count 2/5 dirty bitmap 0


~/Downloads$ sudo ./ectool --name=cros_fp fpstats
FP stats (t0=254287199 us):
Last capture time:  91375 us
Last matching time: Invalid
Last overall time:  Invalid


~/Downloads$ sudo ./ectool --name=cros_fp uptimeinfo
EC uptime: 442.904 seconds
AP resets since EC boot: 0
Most recent AP reset causes:
EC reset flags at last EC boot: reset-pin | power-on | sysjump

I am currently implementing the missing features (saving and loading of prints) from the libfrpint PR on my github.

I implemented the downloading and saving of prints, and I am in the process of implementing the uploading of the prints.
But I am having issues if I follow the steps described by @ChocolateLoverRaj to save and upload prints. The uploaded prints do not work. (not in with my libfrpint implementation and not if I do it manually with the ectool)
If I follow the commands, I am able to enroll a print and save it (the save file is not empty).
I am also able to match a freshly enrolled print.
But if I reset and reupload the print, I cannot match it successfully.
In fact, as soon as one uploaded print is present on the sensor, matching stops working for all prints, even freshly enrolled ones, that worked directly before the upload command.

I tried both the c and rust versions of the ectool and all combinations for up and downloading.
I am also always setting the seed.

Does anybody know what my issue is? @ChocolateLoverRaj, did you have similar issues with your driver, and if yes, how did you solve it?

I did not have issues on jinlon. It issue you are getting might be Chromebook specific. I will try on a redrix soon. One thing that you may have to do in libfprint is set delays between FP commands in general. I don’t remember exactly which places, but I think I have coded delays after setting the seed and between uploading templates in rust-fp.

Also @Xelef2000 are you the same person who opened the merge request on libfprint GitLab?

Thanks for the answer.
I was hoping you knew the solution since your driver worked flawlessly when I tried it. ( I am also using a jinlon)
I will have to study your code then :smiley:
And I am not the person who opened the original PR.
I will try to complete the driver and then coordinate with the project to upstream it.

I tested the rust-fp driver again, and the uploading of prints doesn’t work (anymore?), meaning that prints no longer work after a reboot, even though fpinfon reports it as uploaded.
I can’t remember if I tested it when I first tried the driver a couple of months ago.
I may have broken the reader during driver development, but I probably need to reinstall chromeos to confirm that.
It isn’t kernel related, I tried all supported versions back to 5.14 and even reverted my nix flake to the time I first tested the rust-fp driver.

@ChocolateLoverRaj
Since you are also using a Jinlon, could you share your firmware version? Maybe there was a regression there.

FP firmware version: In search of contributors to a Linux Chromebook fingerprint PAM module - #60 by ChocolateLoverRaj
EC firmware version:

RO version:    jinlon_v2.0.2818-d0268d1f8
RW version:    jinlon_v2.0.2860-ebd66b91b2
Firmware copy: RW
Build info:    jinlon_v2.0.2860-ebd66b91b2 2022-02-24 19:25:19 MrChromebox
Tool version:  0.0.1-isolate Jan  1 1980 none

Chromebook firmware:

Version: MrChromebox-2408.1
        Release Date: 09/14/2024

I am getting this same error on a Redrix. I will investigate this error.

@claydoh I’m pretty sure I found out how to solve this. I will update rust-fp and let you know when to test it.

1 Like

I solved my issue.
A 32-byte user context needs to be set.

sudo ectool --name=cros_fp fpcontext aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 

So the order would be:

  1. set seed
  2. set user context
  3. save print
  4. reset sensor
  5. set seed if sensor was reset by sleep or reboot
  6. set context
  7. load fingerprint
  8. match

This is probably required on newer firmware versions.

@claydoh @WeirdTreeThing I fixed it, can you try and see if it works for your Chromebook now?

1 Like

Thanks!
I will give it a go when I am done working.

@Xelef2000 let me know when the driver is ready to test since I am using GNOME and my rust-fp doesn’t work with GNOME.