Skip to content

Compiling with USE_HIDAPI (hid_hidapi.c) generate a race condition when unlocking multiple devices #995

Open

Description

@aplanas

What version of libfido2 are you using?

1.16.0 / main

What operating system are you running?

Linux (openSUSE)

What application are you using in conjunction with libfido2?

systemd (v261.2)

How does the problem manifest itself?

When multiple devices needs to be unlocked and USE_HIDAPI is used as a compilation option, we have this error:

Failed to open FIDO2 device /dev/hidraw2: FIDO_ERR_RX
Token returned error during pre-flight: Input/output error

Is the problem reproducible?

Yes, for a direct reproducer see: systemd/systemd#35671

What are the steps that lead to the problem?

See systemd/systemd#35671

Seem that the problem is related to using hid_hidapi.c, that does not use flock in contrast as hid_linux.c.

Activity

  1. self-assigned this
    on Oct 5, 2026
  2. dacav commented on Oct 6, 2026

    @dacav
    Contributor

    @aplanas
    I could reproduce the problem. The fix you suggest seems to do the job: #1001
    I need to test it further, and make sure it is portable.

  3. dacav commented on Oct 12, 2026

    @dacav
    Contributor

    @aplanas
    I checked some portability.
    I don't have time to look into more, for the moment. But would the current changes in #1001 work for your case?
    It seems to have fixed the problem at my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug reportSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions