Page MenuHomeFreeBSD

u2f(4): a HID driver for FIDO/U2F security keys
ClosedPublic

Authored by wulf on Jul 28 2025, 9:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 11, 12:55 AM
Unknown Object (File)
Sat, Oct 11, 12:55 AM
Unknown Object (File)
Sat, Oct 11, 12:55 AM
Unknown Object (File)
Sat, Oct 11, 12:55 AM
Unknown Object (File)
Fri, Oct 10, 6:15 PM
Unknown Object (File)
Wed, Oct 8, 9:01 PM
Unknown Object (File)
Fri, Oct 3, 9:25 AM
Unknown Object (File)
Wed, Oct 1, 4:17 AM

Details

Summary

While FIDO/U2F keys were already supported by the generic uhid(4) and
hidraw(4) drivers, this driver adds some additional features an does
steps to tighten the security of FIDO/U2F access.

  • It automatically loads through devd.
  • Automatically enables HQ_NO_READAHEAD for FIDO/U2F devices.
  • Implements only miminum set of features.
  • Do not requires external devfs configuration to set character device permissions.
  • Names character device as u2f/# to make possible capsicum or any other pledge()-style sandboxing.

PR: 265528
MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

wulf requested review of this revision.Jul 28 2025, 9:38 PM

No other problems but some notes:

  1. There is a kind of device call u2f zero that has customized blink command support and hardware rng. Other thing are same as normal u2f device. We can add support to these special device in the future.
  2. The u2fhid support channel id (first few bytes) in their packet. Therefore, it is possible for multiple process to open this device by recording all channel usage status.
sys/dev/hid/u2f.c
304

Should we clear sel flag since the device closed?

This revision was not accepted when it landed; it landed in state Needs Review.Aug 17 2025, 9:04 PM
This revision was automatically updated to reflect the committed changes.