Bug 247588 - Bluetooth HCI unprivileged socket has no LE access
Summary: Bluetooth HCI unprivileged socket has no LE access
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Takanori Watanabe
Depends on:
Reported: 2020-06-27 13:31 UTC by Greg V
Modified: 2020-07-01 04:01 UTC (History)
3 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Greg V 2020-06-27 13:31:29 UTC
Scanning for Bluetooth Low Energy (BLE) beacons currently requires root access, which is ehhhh not great.

From a quick look at the code, looks like setting some bits for allowing LE commands/events was intended, but no bits are set:


OCF_LE_SET_SCAN_PARAMETERS and OCF_LE_SET_SCAN_ENABLE should definitely be accessible.. and at least 0x3e (LE meta) events should be readable, I don't see what in the code would block them but I haven't got them as non-root.

Also, maybe all of this should be controllable via sysctls.
Comment 1 Takanori Watanabe freebsd_committer 2020-06-30 04:28:35 UTC
Please try this patch.

Comment 2 commit-hook freebsd_committer 2020-07-01 04:00:59 UTC
A commit references this bug:

Author: takawata
Date: Wed Jul  1 04:00:55 UTC 2020
New revision: 362825
URL: https://svnweb.freebsd.org/changeset/base/362825

  Allow some Bluetooth LE related HCI request to non-root user.

  PR:	247588
  Reported by:	Greg V (greg@unrelenting.technology)
  Reviewed by:	emax
  Differential Revision:	https://reviews.freebsd.org/D25516