Linux-Bluetooth Archive on lore.kernel.org
 help / color / Atom feed
* OCF_READ_LOCAL_CODECS is permitted only for root user
@ 2019-12-28 17:12 Pali Rohár
  2020-01-04  9:44 ` Marcel Holtmann
  0 siblings, 1 reply; 4+ messages in thread
From: Pali Rohár @ 2019-12-28 17:12 UTC (permalink / raw)
  To: linux-bluetooth

[-- Attachment #1: Type: text/plain, Size: 719 bytes --]

Hello!

I wrote a simple script "sco_features.pl" which show all supported
codecs by local HCI bluetooth adapter. Script is available at:

https://github.com/pali/hsphfpd-prototype/blob/prototype/sco_features.pl

And I found out that OCF_READ_LOCAL_CODECS HCI command cannot be send by
non-root user. Kernel returns "Operation not permitted" error.

What is reason that kernel blocks OCF_READ_LOCAL_CODECS command for
non-root users? Without it (audio) application does not know which
codecs local bluetooth adapter supports.

E.g. OCF_READ_LOCAL_EXT_FEATURES or OCF_READ_VOICE_SETTING commands can
be send also by non-root user and kernel does not block them.

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: OCF_READ_LOCAL_CODECS is permitted only for root user
  2019-12-28 17:12 OCF_READ_LOCAL_CODECS is permitted only for root user Pali Rohár
@ 2020-01-04  9:44 ` Marcel Holtmann
  2020-01-04 10:24   ` Pali Rohár
  0 siblings, 1 reply; 4+ messages in thread
From: Marcel Holtmann @ 2020-01-04  9:44 UTC (permalink / raw)
  To: Pali Rohár; +Cc: linux-bluetooth

Hi Pali,

> I wrote a simple script "sco_features.pl" which show all supported
> codecs by local HCI bluetooth adapter. Script is available at:
> 
> https://github.com/pali/hsphfpd-prototype/blob/prototype/sco_features.pl
> 
> And I found out that OCF_READ_LOCAL_CODECS HCI command cannot be send by
> non-root user. Kernel returns "Operation not permitted" error.
> 
> What is reason that kernel blocks OCF_READ_LOCAL_CODECS command for
> non-root users? Without it (audio) application does not know which
> codecs local bluetooth adapter supports.
> 
> E.g. OCF_READ_LOCAL_EXT_FEATURES or OCF_READ_VOICE_SETTING commands can
> be send also by non-root user and kernel does not block them.

actually the direct access to HCI commands is being removed. So we have no plans to add new commands into the list since that it what the kernel is suppose to handle. If we wanted to expose this, then it has to be via mgmt.

Regards

Marcel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: OCF_READ_LOCAL_CODECS is permitted only for root user
  2020-01-04  9:44 ` Marcel Holtmann
@ 2020-01-04 10:24   ` Pali Rohár
  2020-02-09 13:21     ` Pali Rohár
  0 siblings, 1 reply; 4+ messages in thread
From: Pali Rohár @ 2020-01-04 10:24 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth

[-- Attachment #1: Type: text/plain, Size: 1459 bytes --]

On Saturday 04 January 2020 10:44:52 Marcel Holtmann wrote:
> Hi Pali,
> 
> > I wrote a simple script "sco_features.pl" which show all supported
> > codecs by local HCI bluetooth adapter. Script is available at:
> > 
> > https://github.com/pali/hsphfpd-prototype/blob/prototype/sco_features.pl
> > 
> > And I found out that OCF_READ_LOCAL_CODECS HCI command cannot be send by
> > non-root user. Kernel returns "Operation not permitted" error.
> > 
> > What is reason that kernel blocks OCF_READ_LOCAL_CODECS command for
> > non-root users? Without it (audio) application does not know which
> > codecs local bluetooth adapter supports.
> > 
> > E.g. OCF_READ_LOCAL_EXT_FEATURES or OCF_READ_VOICE_SETTING commands can
> > be send also by non-root user and kernel does not block them.
> 
> actually the direct access to HCI commands is being removed. So we have no plans to add new commands into the list since that it what the kernel is suppose to handle. If we wanted to expose this, then it has to be via mgmt.

Hi Marcel! Thank you for information. I have not know that this API is
"deprecated" and is going to be removed. But userspace audio
applications need to know what bluetooth adapter supports, so can you
export result of these commands to userspace? My script linked above
calls: OCF_READ_VOICE_SETTING, OCF_READ_LOCAL_COMMANDS,
OCF_READ_LOCAL_EXT_FEATURES, OCF_READ_LOCAL_CODECS

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: OCF_READ_LOCAL_CODECS is permitted only for root user
  2020-01-04 10:24   ` Pali Rohár
@ 2020-02-09 13:21     ` Pali Rohár
  0 siblings, 0 replies; 4+ messages in thread
From: Pali Rohár @ 2020-02-09 13:21 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth, David Heidelberg

On Saturday 04 January 2020 11:24:36 Pali Rohár wrote:
> On Saturday 04 January 2020 10:44:52 Marcel Holtmann wrote:
> > Hi Pali,
> > 
> > > I wrote a simple script "sco_features.pl" which show all supported
> > > codecs by local HCI bluetooth adapter. Script is available at:
> > > 
> > > https://github.com/pali/hsphfpd-prototype/blob/prototype/sco_features.pl
> > > 
> > > And I found out that OCF_READ_LOCAL_CODECS HCI command cannot be send by
> > > non-root user. Kernel returns "Operation not permitted" error.
> > > 
> > > What is reason that kernel blocks OCF_READ_LOCAL_CODECS command for
> > > non-root users? Without it (audio) application does not know which
> > > codecs local bluetooth adapter supports.
> > > 
> > > E.g. OCF_READ_LOCAL_EXT_FEATURES or OCF_READ_VOICE_SETTING commands can
> > > be send also by non-root user and kernel does not block them.
> > 
> > actually the direct access to HCI commands is being removed. So we have no plans to add new commands into the list since that it what the kernel is suppose to handle. If we wanted to expose this, then it has to be via mgmt.
> 
> Hi Marcel! Thank you for information. I have not know that this API is
> "deprecated" and is going to be removed. But userspace audio
> applications need to know what bluetooth adapter supports, so can you
> export result of these commands to userspace? My script linked above
> calls: OCF_READ_VOICE_SETTING, OCF_READ_LOCAL_COMMANDS,
> OCF_READ_LOCAL_EXT_FEATURES, OCF_READ_LOCAL_CODECS

Hello! Just a gently reminder for this question. How to retrieve
information about supported codecs from userspace by non-root user?
Because running all bluetooth audio applications by root is not really a
solution. Plus if above API for root user is going to be removed, what
is a replacement?

-- 
Pali Rohár
pali.rohar@gmail.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-28 17:12 OCF_READ_LOCAL_CODECS is permitted only for root user Pali Rohár
2020-01-04  9:44 ` Marcel Holtmann
2020-01-04 10:24   ` Pali Rohár
2020-02-09 13:21     ` Pali Rohár

Linux-Bluetooth Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-bluetooth/0 linux-bluetooth/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-bluetooth linux-bluetooth/ https://lore.kernel.org/linux-bluetooth \
		linux-bluetooth@vger.kernel.org
	public-inbox-index linux-bluetooth

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-bluetooth


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git