linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / 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; 19+ 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] 19+ 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; 19+ 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] 19+ 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; 19+ 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] 19+ 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
  2020-04-14 22:56       ` Removal of HCI commands? (Was: Re: OCF_READ_LOCAL_CODECS is permitted only for root user) Pali Rohár
  0 siblings, 1 reply; 19+ 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] 19+ messages in thread

* Removal of HCI commands? (Was: Re: OCF_READ_LOCAL_CODECS is permitted only for root user)
  2020-02-09 13:21     ` Pali Rohár
@ 2020-04-14 22:56       ` Pali Rohár
  2020-08-08 13:27         ` Pali Rohár
  0 siblings, 1 reply; 19+ messages in thread
From: Pali Rohár @ 2020-04-14 22:56 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, David S. Miller, Jakub Kicinski,
	Pavel Machek, Luiz Augusto von Dentz, Sebastian Reichel,
	David Heidelberg
  Cc: linux-bluetooth, linux-kernel

On Sunday 09 February 2020 14:21:37 Pali Rohár wrote:
> 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?

Hello!

I have not got any answer to my email from Marcel for months, so I'm
adding other developers to loop. Could somebody tell me that is the
replacement API if above one is going to be removed?

I was not able to find any documentation where could be described this
API nor information about deprecation / removal.

And are you aware of the fact that removing of API could potentially
break existing applications?

I really need to know which API should I use, because when I use API
which is going to be removed, then my application stops working. And I
really want to avoid it.

Also I have not got any response yet, how can I read list of supported
codecs by bluetooth adapter by ordinary non-root user? Audio application
needs to know list of supported codecs and it is really insane to run it
as root.

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

* Re: Removal of HCI commands? (Was: Re: OCF_READ_LOCAL_CODECS is permitted only for root user)
  2020-04-14 22:56       ` Removal of HCI commands? (Was: Re: OCF_READ_LOCAL_CODECS is permitted only for root user) Pali Rohár
@ 2020-08-08 13:27         ` Pali Rohár
  2020-09-29 21:32           ` Removal of HCI commands, userspace bluetooth regression? Pali Rohár
  0 siblings, 1 reply; 19+ messages in thread
From: Pali Rohár @ 2020-08-08 13:27 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, David S. Miller, Jakub Kicinski,
	Pavel Machek, Luiz Augusto von Dentz, Sebastian Reichel,
	David Heidelberg
  Cc: linux-bluetooth, linux-kernel

On Wednesday 15 April 2020 00:56:18 Pali Rohár wrote:
> On Sunday 09 February 2020 14:21:37 Pali Rohár wrote:
> > 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?
> 
> Hello!
> 
> I have not got any answer to my email from Marcel for months, so I'm
> adding other developers to loop. Could somebody tell me that is the
> replacement API if above one is going to be removed?
> 
> I was not able to find any documentation where could be described this
> API nor information about deprecation / removal.
> 
> And are you aware of the fact that removing of API could potentially
> break existing applications?
> 
> I really need to know which API should I use, because when I use API
> which is going to be removed, then my application stops working. And I
> really want to avoid it.
> 
> Also I have not got any response yet, how can I read list of supported
> codecs by bluetooth adapter by ordinary non-root user? Audio application
> needs to know list of supported codecs and it is really insane to run it
> as root.

Hello! This is just another reminder that I have not got any reply to
this email.

Does silence mean that audio applications are expected to work only
under root account and ordinary users are not able to use audio and list
supported codecs?

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

* Removal of HCI commands, userspace bluetooth regression?
  2020-08-08 13:27         ` Pali Rohár
@ 2020-09-29 21:32           ` Pali Rohár
  2020-09-30  8:02             ` Greg Kroah-Hartman
  0 siblings, 1 reply; 19+ messages in thread
From: Pali Rohár @ 2020-09-29 21:32 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, David S. Miller, Jakub Kicinski,
	Pavel Machek, Luiz Augusto von Dentz, Sebastian Reichel,
	David Heidelberg, Greg Kroah-Hartman, Linus Torvalds
  Cc: linux-bluetooth, netdev, linux-kernel

CCing other lists and maintainers, hopefully, somebody would have a time to look at it...

On Saturday 08 August 2020 15:27:47 Pali Rohár wrote:
> On Wednesday 15 April 2020 00:56:18 Pali Rohár wrote:
> > On Sunday 09 February 2020 14:21:37 Pali Rohár wrote:
> > > 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?
> > 
> > Hello!
> > 
> > I have not got any answer to my email from Marcel for months, so I'm
> > adding other developers to loop. Could somebody tell me that is the
> > replacement API if above one is going to be removed?
> > 
> > I was not able to find any documentation where could be described this
> > API nor information about deprecation / removal.
> > 
> > And are you aware of the fact that removing of API could potentially
> > break existing applications?
> > 
> > I really need to know which API should I use, because when I use API
> > which is going to be removed, then my application stops working. And I
> > really want to avoid it.
> > 
> > Also I have not got any response yet, how can I read list of supported
> > codecs by bluetooth adapter by ordinary non-root user? Audio application
> > needs to know list of supported codecs and it is really insane to run it
> > as root.
> 
> Hello! This is just another reminder that I have not got any reply to
> this email.
> 
> Does silence mean that audio applications are expected to work only
> under root account and ordinary users are not able to use audio and list
> supported codecs?

Hello! I have not got any reply for this issue for 10 months and if you
are going to remove (or after these 10 months you already did it?)
existing HCI API from kernel it would break existing and working
userspace application. How do you want to handle such regressions?

I think that more people in past said that there should not be
regressions in userspace applications caused by kernel changes (e.g.
removing of API).

Also, could you please say something about root requirement for listing
supported codecs? At least clarifying something like

  "kernel allows only processes with uid=0 to access list of supported
  bluetooth audio codecs, effectively means requirement of bluetooth
  audio applications to run as root; and kernel developers do not have
  a time to discuss any future changes on this topic"

would be nice to know what is current state or future, so developers of
userspace bluetooth applications would know what should they do or
expect.


I really dislike this situation when after 10 months I just get
information that API for userspace is being removed without any
replacement and without any discussion how to handle issues and
transition period.

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

* Re: Removal of HCI commands, userspace bluetooth regression?
  2020-09-29 21:32           ` Removal of HCI commands, userspace bluetooth regression? Pali Rohár
@ 2020-09-30  8:02             ` Greg Kroah-Hartman
  2020-09-30  8:16               ` Marcel Holtmann
  2020-09-30  8:25               ` Pali Rohár
  0 siblings, 2 replies; 19+ messages in thread
From: Greg Kroah-Hartman @ 2020-09-30  8:02 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Marcel Holtmann, Johan Hedberg, David S. Miller, Jakub Kicinski,
	Pavel Machek, Luiz Augusto von Dentz, Sebastian Reichel,
	David Heidelberg, Linus Torvalds, linux-bluetooth, netdev,
	linux-kernel

On Tue, Sep 29, 2020 at 11:32:54PM +0200, Pali Rohár wrote:
> CCing other lists and maintainers, hopefully, somebody would have a time to look at it...
> 
> On Saturday 08 August 2020 15:27:47 Pali Rohár wrote:
> > On Wednesday 15 April 2020 00:56:18 Pali Rohár wrote:
> > > On Sunday 09 February 2020 14:21:37 Pali Rohár wrote:
> > > > 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?
> > > 
> > > Hello!
> > > 
> > > I have not got any answer to my email from Marcel for months, so I'm
> > > adding other developers to loop. Could somebody tell me that is the
> > > replacement API if above one is going to be removed?
> > > 
> > > I was not able to find any documentation where could be described this
> > > API nor information about deprecation / removal.
> > > 
> > > And are you aware of the fact that removing of API could potentially
> > > break existing applications?
> > > 
> > > I really need to know which API should I use, because when I use API
> > > which is going to be removed, then my application stops working. And I
> > > really want to avoid it.
> > > 
> > > Also I have not got any response yet, how can I read list of supported
> > > codecs by bluetooth adapter by ordinary non-root user? Audio application
> > > needs to know list of supported codecs and it is really insane to run it
> > > as root.
> > 
> > Hello! This is just another reminder that I have not got any reply to
> > this email.
> > 
> > Does silence mean that audio applications are expected to work only
> > under root account and ordinary users are not able to use audio and list
> > supported codecs?
> 
> Hello! I have not got any reply for this issue for 10 months and if you
> are going to remove (or after these 10 months you already did it?)
> existing HCI API from kernel it would break existing and working
> userspace application. How do you want to handle such regressions?

What git commit caused this regression?

thanks,

greg k-h

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

* Re: Removal of HCI commands, userspace bluetooth regression?
  2020-09-30  8:02             ` Greg Kroah-Hartman
@ 2020-09-30  8:16               ` Marcel Holtmann
  2020-09-30  9:20                 ` Greg Kroah-Hartman
  2020-09-30  8:25               ` Pali Rohár
  1 sibling, 1 reply; 19+ messages in thread
From: Marcel Holtmann @ 2020-09-30  8:16 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Pali Rohár, Johan Hedberg, David S. Miller, Jakub Kicinski,
	Pavel Machek, Luiz Augusto von Dentz, Sebastian Reichel,
	David Heidelberg, Linus Torvalds, linux-bluetooth,
	open list:NETWORKING [GENERAL],
	linux-kernel

Hi Greg,

>>>>>>>> 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?
>>>> 
>>>> Hello!
>>>> 
>>>> I have not got any answer to my email from Marcel for months, so I'm
>>>> adding other developers to loop. Could somebody tell me that is the
>>>> replacement API if above one is going to be removed?
>>>> 
>>>> I was not able to find any documentation where could be described this
>>>> API nor information about deprecation / removal.
>>>> 
>>>> And are you aware of the fact that removing of API could potentially
>>>> break existing applications?
>>>> 
>>>> I really need to know which API should I use, because when I use API
>>>> which is going to be removed, then my application stops working. And I
>>>> really want to avoid it.
>>>> 
>>>> Also I have not got any response yet, how can I read list of supported
>>>> codecs by bluetooth adapter by ordinary non-root user? Audio application
>>>> needs to know list of supported codecs and it is really insane to run it
>>>> as root.
>>> 
>>> Hello! This is just another reminder that I have not got any reply to
>>> this email.
>>> 
>>> Does silence mean that audio applications are expected to work only
>>> under root account and ordinary users are not able to use audio and list
>>> supported codecs?
>> 
>> Hello! I have not got any reply for this issue for 10 months and if you
>> are going to remove (or after these 10 months you already did it?)
>> existing HCI API from kernel it would break existing and working
>> userspace application. How do you want to handle such regressions?
> 
> What git commit caused this regression?

there is no regression!

New Bluetooth standards added new HCI commands that are just not exposed to unprivileged users.

Regards

Marcel


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

* Re: Removal of HCI commands, userspace bluetooth regression?
  2020-09-30  8:02             ` Greg Kroah-Hartman
  2020-09-30  8:16               ` Marcel Holtmann
@ 2020-09-30  8:25               ` Pali Rohár
  2020-09-30  9:20                 ` Greg Kroah-Hartman
  1 sibling, 1 reply; 19+ messages in thread
From: Pali Rohár @ 2020-09-30  8:25 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Marcel Holtmann, Johan Hedberg, David S. Miller, Jakub Kicinski,
	Pavel Machek, Luiz Augusto von Dentz, Sebastian Reichel,
	David Heidelberg, Linus Torvalds, linux-bluetooth, netdev,
	linux-kernel

On Wednesday 30 September 2020 10:02:05 Greg Kroah-Hartman wrote:
> On Tue, Sep 29, 2020 at 11:32:54PM +0200, Pali Rohár wrote:
> > CCing other lists and maintainers, hopefully, somebody would have a time to look at it...
> > 
> > On Saturday 08 August 2020 15:27:47 Pali Rohár wrote:
> > > On Wednesday 15 April 2020 00:56:18 Pali Rohár wrote:
> > > > On Sunday 09 February 2020 14:21:37 Pali Rohár wrote:
> > > > > 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?
> > > > 
> > > > Hello!
> > > > 
> > > > I have not got any answer to my email from Marcel for months, so I'm
> > > > adding other developers to loop. Could somebody tell me that is the
> > > > replacement API if above one is going to be removed?
> > > > 
> > > > I was not able to find any documentation where could be described this
> > > > API nor information about deprecation / removal.
> > > > 
> > > > And are you aware of the fact that removing of API could potentially
> > > > break existing applications?
> > > > 
> > > > I really need to know which API should I use, because when I use API
> > > > which is going to be removed, then my application stops working. And I
> > > > really want to avoid it.
> > > > 
> > > > Also I have not got any response yet, how can I read list of supported
> > > > codecs by bluetooth adapter by ordinary non-root user? Audio application
> > > > needs to know list of supported codecs and it is really insane to run it
> > > > as root.
> > > 
> > > Hello! This is just another reminder that I have not got any reply to
> > > this email.
> > > 
> > > Does silence mean that audio applications are expected to work only
> > > under root account and ordinary users are not able to use audio and list
> > > supported codecs?
> > 
> > Hello! I have not got any reply for this issue for 10 months and if you
> > are going to remove (or after these 10 months you already did it?)
> > existing HCI API from kernel it would break existing and working
> > userspace application. How do you want to handle such regressions?
> 
> What git commit caused this regression?

Hello! Marcel in January wrote that access for HCI commands is being
removed from kernel. I do not know if he managed to do it in since
January, but I'm going to check it...

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

* Re: Removal of HCI commands, userspace bluetooth regression?
  2020-09-30  8:16               ` Marcel Holtmann
@ 2020-09-30  9:20                 ` Greg Kroah-Hartman
  2020-09-30  9:49                   ` Pali Rohár
  0 siblings, 1 reply; 19+ messages in thread
From: Greg Kroah-Hartman @ 2020-09-30  9:20 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: Pali Rohár, Johan Hedberg, David S. Miller, Jakub Kicinski,
	Pavel Machek, Luiz Augusto von Dentz, Sebastian Reichel,
	David Heidelberg, Linus Torvalds, linux-bluetooth,
	open list:NETWORKING [GENERAL],
	linux-kernel

On Wed, Sep 30, 2020 at 10:16:40AM +0200, Marcel Holtmann wrote:
> Hi Greg,
> 
> >>>>>>>> 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?
> >>>> 
> >>>> Hello!
> >>>> 
> >>>> I have not got any answer to my email from Marcel for months, so I'm
> >>>> adding other developers to loop. Could somebody tell me that is the
> >>>> replacement API if above one is going to be removed?
> >>>> 
> >>>> I was not able to find any documentation where could be described this
> >>>> API nor information about deprecation / removal.
> >>>> 
> >>>> And are you aware of the fact that removing of API could potentially
> >>>> break existing applications?
> >>>> 
> >>>> I really need to know which API should I use, because when I use API
> >>>> which is going to be removed, then my application stops working. And I
> >>>> really want to avoid it.
> >>>> 
> >>>> Also I have not got any response yet, how can I read list of supported
> >>>> codecs by bluetooth adapter by ordinary non-root user? Audio application
> >>>> needs to know list of supported codecs and it is really insane to run it
> >>>> as root.
> >>> 
> >>> Hello! This is just another reminder that I have not got any reply to
> >>> this email.
> >>> 
> >>> Does silence mean that audio applications are expected to work only
> >>> under root account and ordinary users are not able to use audio and list
> >>> supported codecs?
> >> 
> >> Hello! I have not got any reply for this issue for 10 months and if you
> >> are going to remove (or after these 10 months you already did it?)
> >> existing HCI API from kernel it would break existing and working
> >> userspace application. How do you want to handle such regressions?
> > 
> > What git commit caused this regression?
> 
> there is no regression!
> 
> New Bluetooth standards added new HCI commands that are just not
> exposed to unprivileged users.

Ok, that makes sense.  What tool takes advantage of these new HCI
commands?

thanks,

greg k-h

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

* Re: Removal of HCI commands, userspace bluetooth regression?
  2020-09-30  8:25               ` Pali Rohár
@ 2020-09-30  9:20                 ` Greg Kroah-Hartman
  2020-09-30  9:46                   ` Pali Rohár
  0 siblings, 1 reply; 19+ messages in thread
From: Greg Kroah-Hartman @ 2020-09-30  9:20 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Marcel Holtmann, Johan Hedberg, David S. Miller, Jakub Kicinski,
	Pavel Machek, Luiz Augusto von Dentz, Sebastian Reichel,
	David Heidelberg, Linus Torvalds, linux-bluetooth, netdev,
	linux-kernel

On Wed, Sep 30, 2020 at 10:25:34AM +0200, Pali Rohár wrote:
> On Wednesday 30 September 2020 10:02:05 Greg Kroah-Hartman wrote:
> > On Tue, Sep 29, 2020 at 11:32:54PM +0200, Pali Rohár wrote:
> > > CCing other lists and maintainers, hopefully, somebody would have a time to look at it...
> > > 
> > > On Saturday 08 August 2020 15:27:47 Pali Rohár wrote:
> > > > On Wednesday 15 April 2020 00:56:18 Pali Rohár wrote:
> > > > > On Sunday 09 February 2020 14:21:37 Pali Rohár wrote:
> > > > > > 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?
> > > > > 
> > > > > Hello!
> > > > > 
> > > > > I have not got any answer to my email from Marcel for months, so I'm
> > > > > adding other developers to loop. Could somebody tell me that is the
> > > > > replacement API if above one is going to be removed?
> > > > > 
> > > > > I was not able to find any documentation where could be described this
> > > > > API nor information about deprecation / removal.
> > > > > 
> > > > > And are you aware of the fact that removing of API could potentially
> > > > > break existing applications?
> > > > > 
> > > > > I really need to know which API should I use, because when I use API
> > > > > which is going to be removed, then my application stops working. And I
> > > > > really want to avoid it.
> > > > > 
> > > > > Also I have not got any response yet, how can I read list of supported
> > > > > codecs by bluetooth adapter by ordinary non-root user? Audio application
> > > > > needs to know list of supported codecs and it is really insane to run it
> > > > > as root.
> > > > 
> > > > Hello! This is just another reminder that I have not got any reply to
> > > > this email.
> > > > 
> > > > Does silence mean that audio applications are expected to work only
> > > > under root account and ordinary users are not able to use audio and list
> > > > supported codecs?
> > > 
> > > Hello! I have not got any reply for this issue for 10 months and if you
> > > are going to remove (or after these 10 months you already did it?)
> > > existing HCI API from kernel it would break existing and working
> > > userspace application. How do you want to handle such regressions?
> > 
> > What git commit caused this regression?
> 
> Hello! Marcel in January wrote that access for HCI commands is being
> removed from kernel. I do not know if he managed to do it in since
> January, but I'm going to check it...

So you don't see a regression/problem, but are saying there is one?

odd...

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

* Re: Removal of HCI commands, userspace bluetooth regression?
  2020-09-30  9:20                 ` Greg Kroah-Hartman
@ 2020-09-30  9:46                   ` Pali Rohár
  2020-09-30 10:54                     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 19+ messages in thread
From: Pali Rohár @ 2020-09-30  9:46 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Marcel Holtmann, Johan Hedberg, David S. Miller, Jakub Kicinski,
	Pavel Machek, Luiz Augusto von Dentz, Sebastian Reichel,
	David Heidelberg, Linus Torvalds, linux-bluetooth, netdev,
	linux-kernel

On Wednesday 30 September 2020 11:20:43 Greg Kroah-Hartman wrote:
> On Wed, Sep 30, 2020 at 10:25:34AM +0200, Pali Rohár wrote:
> > On Wednesday 30 September 2020 10:02:05 Greg Kroah-Hartman wrote:
> > > On Tue, Sep 29, 2020 at 11:32:54PM +0200, Pali Rohár wrote:
> > > > CCing other lists and maintainers, hopefully, somebody would have a time to look at it...
> > > > 
> > > > On Saturday 08 August 2020 15:27:47 Pali Rohár wrote:
> > > > > On Wednesday 15 April 2020 00:56:18 Pali Rohár wrote:
> > > > > > On Sunday 09 February 2020 14:21:37 Pali Rohár wrote:
> > > > > > > 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?
> > > > > > 
> > > > > > Hello!
> > > > > > 
> > > > > > I have not got any answer to my email from Marcel for months, so I'm
> > > > > > adding other developers to loop. Could somebody tell me that is the
> > > > > > replacement API if above one is going to be removed?
> > > > > > 
> > > > > > I was not able to find any documentation where could be described this
> > > > > > API nor information about deprecation / removal.
> > > > > > 
> > > > > > And are you aware of the fact that removing of API could potentially
> > > > > > break existing applications?
> > > > > > 
> > > > > > I really need to know which API should I use, because when I use API
> > > > > > which is going to be removed, then my application stops working. And I
> > > > > > really want to avoid it.
> > > > > > 
> > > > > > Also I have not got any response yet, how can I read list of supported
> > > > > > codecs by bluetooth adapter by ordinary non-root user? Audio application
> > > > > > needs to know list of supported codecs and it is really insane to run it
> > > > > > as root.
> > > > > 
> > > > > Hello! This is just another reminder that I have not got any reply to
> > > > > this email.
> > > > > 
> > > > > Does silence mean that audio applications are expected to work only
> > > > > under root account and ordinary users are not able to use audio and list
> > > > > supported codecs?
> > > > 
> > > > Hello! I have not got any reply for this issue for 10 months and if you
> > > > are going to remove (or after these 10 months you already did it?)
> > > > existing HCI API from kernel it would break existing and working
> > > > userspace application. How do you want to handle such regressions?
> > > 
> > > What git commit caused this regression?
> > 
> > Hello! Marcel in January wrote that access for HCI commands is being
> > removed from kernel. I do not know if he managed to do it in since
> > January, but I'm going to check it...
> 
> So you don't see a regression/problem, but are saying there is one?

Hello!

Planed removal of used API would be a regression. Marcel wrote that it
is "being removed". Nobody reacted to that fact for 10 months so I did
not know if this comment was lost and removal is already in progress.
Or if something was changed and removal is not planned anymore.

So are you aware that it will break applications?

> odd...

I think it is not a good idea to do something and then check what happen
if there are people who know that such thing is in use and for sure it
will break something.

And also I still did not get any response what is the replacement of
that API.

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

* Re: Removal of HCI commands, userspace bluetooth regression?
  2020-09-30  9:20                 ` Greg Kroah-Hartman
@ 2020-09-30  9:49                   ` Pali Rohár
  0 siblings, 0 replies; 19+ messages in thread
From: Pali Rohár @ 2020-09-30  9:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Marcel Holtmann, Johan Hedberg, David S. Miller, Jakub Kicinski,
	Pavel Machek, Luiz Augusto von Dentz, Sebastian Reichel,
	David Heidelberg, Linus Torvalds, linux-bluetooth,
	open list:NETWORKING [GENERAL],
	linux-kernel

On Wednesday 30 September 2020 11:20:20 Greg Kroah-Hartman wrote:
> On Wed, Sep 30, 2020 at 10:16:40AM +0200, Marcel Holtmann wrote:
> > Hi Greg,
> > 
> > >>>>>>>> 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?
> > >>>> 
> > >>>> Hello!
> > >>>> 
> > >>>> I have not got any answer to my email from Marcel for months, so I'm
> > >>>> adding other developers to loop. Could somebody tell me that is the
> > >>>> replacement API if above one is going to be removed?
> > >>>> 
> > >>>> I was not able to find any documentation where could be described this
> > >>>> API nor information about deprecation / removal.
> > >>>> 
> > >>>> And are you aware of the fact that removing of API could potentially
> > >>>> break existing applications?
> > >>>> 
> > >>>> I really need to know which API should I use, because when I use API
> > >>>> which is going to be removed, then my application stops working. And I
> > >>>> really want to avoid it.
> > >>>> 
> > >>>> Also I have not got any response yet, how can I read list of supported
> > >>>> codecs by bluetooth adapter by ordinary non-root user? Audio application
> > >>>> needs to know list of supported codecs and it is really insane to run it
> > >>>> as root.
> > >>> 
> > >>> Hello! This is just another reminder that I have not got any reply to
> > >>> this email.
> > >>> 
> > >>> Does silence mean that audio applications are expected to work only
> > >>> under root account and ordinary users are not able to use audio and list
> > >>> supported codecs?
> > >> 
> > >> Hello! I have not got any reply for this issue for 10 months and if you
> > >> are going to remove (or after these 10 months you already did it?)
> > >> existing HCI API from kernel it would break existing and working
> > >> userspace application. How do you want to handle such regressions?
> > > 
> > > What git commit caused this regression?
> > 
> > there is no regression!
> > 
> > New Bluetooth standards added new HCI commands that are just not
> > exposed to unprivileged users.
> 
> Ok, that makes sense.  What tool takes advantage of these new HCI
> commands?

sco_features as written above (in quoted part).

And today also main daemon in that repository.

> thanks,
> 
> greg k-h

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

* Re: Removal of HCI commands, userspace bluetooth regression?
  2020-09-30  9:46                   ` Pali Rohár
@ 2020-09-30 10:54                     ` Greg Kroah-Hartman
  2020-09-30 11:00                       ` Pali Rohár
  0 siblings, 1 reply; 19+ messages in thread
From: Greg Kroah-Hartman @ 2020-09-30 10:54 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Marcel Holtmann, Johan Hedberg, David S. Miller, Jakub Kicinski,
	Pavel Machek, Luiz Augusto von Dentz, Sebastian Reichel,
	David Heidelberg, Linus Torvalds, linux-bluetooth, netdev,
	linux-kernel

On Wed, Sep 30, 2020 at 11:46:16AM +0200, Pali Rohár wrote:
> On Wednesday 30 September 2020 11:20:43 Greg Kroah-Hartman wrote:
> > On Wed, Sep 30, 2020 at 10:25:34AM +0200, Pali Rohár wrote:
> > > On Wednesday 30 September 2020 10:02:05 Greg Kroah-Hartman wrote:
> > > > On Tue, Sep 29, 2020 at 11:32:54PM +0200, Pali Rohár wrote:
> > > > > CCing other lists and maintainers, hopefully, somebody would have a time to look at it...
> > > > > 
> > > > > On Saturday 08 August 2020 15:27:47 Pali Rohár wrote:
> > > > > > On Wednesday 15 April 2020 00:56:18 Pali Rohár wrote:
> > > > > > > On Sunday 09 February 2020 14:21:37 Pali Rohár wrote:
> > > > > > > > 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?
> > > > > > > 
> > > > > > > Hello!
> > > > > > > 
> > > > > > > I have not got any answer to my email from Marcel for months, so I'm
> > > > > > > adding other developers to loop. Could somebody tell me that is the
> > > > > > > replacement API if above one is going to be removed?
> > > > > > > 
> > > > > > > I was not able to find any documentation where could be described this
> > > > > > > API nor information about deprecation / removal.
> > > > > > > 
> > > > > > > And are you aware of the fact that removing of API could potentially
> > > > > > > break existing applications?
> > > > > > > 
> > > > > > > I really need to know which API should I use, because when I use API
> > > > > > > which is going to be removed, then my application stops working. And I
> > > > > > > really want to avoid it.
> > > > > > > 
> > > > > > > Also I have not got any response yet, how can I read list of supported
> > > > > > > codecs by bluetooth adapter by ordinary non-root user? Audio application
> > > > > > > needs to know list of supported codecs and it is really insane to run it
> > > > > > > as root.
> > > > > > 
> > > > > > Hello! This is just another reminder that I have not got any reply to
> > > > > > this email.
> > > > > > 
> > > > > > Does silence mean that audio applications are expected to work only
> > > > > > under root account and ordinary users are not able to use audio and list
> > > > > > supported codecs?
> > > > > 
> > > > > Hello! I have not got any reply for this issue for 10 months and if you
> > > > > are going to remove (or after these 10 months you already did it?)
> > > > > existing HCI API from kernel it would break existing and working
> > > > > userspace application. How do you want to handle such regressions?
> > > > 
> > > > What git commit caused this regression?
> > > 
> > > Hello! Marcel in January wrote that access for HCI commands is being
> > > removed from kernel. I do not know if he managed to do it in since
> > > January, but I'm going to check it...
> > 
> > So you don't see a regression/problem, but are saying there is one?
> 
> Hello!
> 
> Planed removal of used API would be a regression. Marcel wrote that it
> is "being removed". Nobody reacted to that fact for 10 months so I did
> not know if this comment was lost and removal is already in progress.
> Or if something was changed and removal is not planned anymore.
> 
> So are you aware that it will break applications?

Does it?

> > odd...
> 
> I think it is not a good idea to do something and then check what happen
> if there are people who know that such thing is in use and for sure it
> will break something.
> 
> And also I still did not get any response what is the replacement of
> that API.

It sounds like only new commands are restricted, so how is that a
regression?

thanks,

greg k-h

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

* Re: Removal of HCI commands, userspace bluetooth regression?
  2020-09-30 10:54                     ` Greg Kroah-Hartman
@ 2020-09-30 11:00                       ` Pali Rohár
  2020-09-30 11:20                         ` Greg Kroah-Hartman
  0 siblings, 1 reply; 19+ messages in thread
From: Pali Rohár @ 2020-09-30 11:00 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Marcel Holtmann, Johan Hedberg, David S. Miller, Jakub Kicinski,
	Pavel Machek, Luiz Augusto von Dentz, Sebastian Reichel,
	David Heidelberg, Linus Torvalds, linux-bluetooth, netdev,
	linux-kernel

On Wednesday 30 September 2020 12:54:34 Greg Kroah-Hartman wrote:
> On Wed, Sep 30, 2020 at 11:46:16AM +0200, Pali Rohár wrote:
> > On Wednesday 30 September 2020 11:20:43 Greg Kroah-Hartman wrote:
> > > On Wed, Sep 30, 2020 at 10:25:34AM +0200, Pali Rohár wrote:
> > > > On Wednesday 30 September 2020 10:02:05 Greg Kroah-Hartman wrote:
> > > > > On Tue, Sep 29, 2020 at 11:32:54PM +0200, Pali Rohár wrote:
> > > > > > CCing other lists and maintainers, hopefully, somebody would have a time to look at it...
> > > > > > 
> > > > > > On Saturday 08 August 2020 15:27:47 Pali Rohár wrote:
> > > > > > > On Wednesday 15 April 2020 00:56:18 Pali Rohár wrote:
> > > > > > > > On Sunday 09 February 2020 14:21:37 Pali Rohár wrote:
> > > > > > > > > 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?
> > > > > > > > 
> > > > > > > > Hello!
> > > > > > > > 
> > > > > > > > I have not got any answer to my email from Marcel for months, so I'm
> > > > > > > > adding other developers to loop. Could somebody tell me that is the
> > > > > > > > replacement API if above one is going to be removed?
> > > > > > > > 
> > > > > > > > I was not able to find any documentation where could be described this
> > > > > > > > API nor information about deprecation / removal.
> > > > > > > > 
> > > > > > > > And are you aware of the fact that removing of API could potentially
> > > > > > > > break existing applications?
> > > > > > > > 
> > > > > > > > I really need to know which API should I use, because when I use API
> > > > > > > > which is going to be removed, then my application stops working. And I
> > > > > > > > really want to avoid it.
> > > > > > > > 
> > > > > > > > Also I have not got any response yet, how can I read list of supported
> > > > > > > > codecs by bluetooth adapter by ordinary non-root user? Audio application
> > > > > > > > needs to know list of supported codecs and it is really insane to run it
> > > > > > > > as root.
> > > > > > > 
> > > > > > > Hello! This is just another reminder that I have not got any reply to
> > > > > > > this email.
> > > > > > > 
> > > > > > > Does silence mean that audio applications are expected to work only
> > > > > > > under root account and ordinary users are not able to use audio and list
> > > > > > > supported codecs?
> > > > > > 
> > > > > > Hello! I have not got any reply for this issue for 10 months and if you
> > > > > > are going to remove (or after these 10 months you already did it?)
> > > > > > existing HCI API from kernel it would break existing and working
> > > > > > userspace application. How do you want to handle such regressions?
> > > > > 
> > > > > What git commit caused this regression?
> > > > 
> > > > Hello! Marcel in January wrote that access for HCI commands is being
> > > > removed from kernel. I do not know if he managed to do it in since
> > > > January, but I'm going to check it...
> > > 
> > > So you don't see a regression/problem, but are saying there is one?
> > 
> > Hello!
> > 
> > Planed removal of used API would be a regression. Marcel wrote that it
> > is "being removed". Nobody reacted to that fact for 10 months so I did
> > not know if this comment was lost and removal is already in progress.
> > Or if something was changed and removal is not planned anymore.
> > 
> > So are you aware that it will break applications?
> 
> Does it?

Of course.

> > > odd...
> > 
> > I think it is not a good idea to do something and then check what happen
> > if there are people who know that such thing is in use and for sure it
> > will break something.
> > 
> > And also I still did not get any response what is the replacement of
> > that API.
> 
> It sounds like only new commands are restricted

So existing are not being removed? It was finally changed and can you confirm it?

> so how is that a regression?
> 
> thanks,
> 
> greg k-h

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

* Re: Removal of HCI commands, userspace bluetooth regression?
  2020-09-30 11:00                       ` Pali Rohár
@ 2020-09-30 11:20                         ` Greg Kroah-Hartman
  2020-09-30 11:51                           ` Pali Rohár
  0 siblings, 1 reply; 19+ messages in thread
From: Greg Kroah-Hartman @ 2020-09-30 11:20 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Marcel Holtmann, Johan Hedberg, David S. Miller, Jakub Kicinski,
	Pavel Machek, Luiz Augusto von Dentz, Sebastian Reichel,
	David Heidelberg, Linus Torvalds, linux-bluetooth, netdev,
	linux-kernel

On Wed, Sep 30, 2020 at 01:00:13PM +0200, Pali Rohár wrote:
> On Wednesday 30 September 2020 12:54:34 Greg Kroah-Hartman wrote:
> > On Wed, Sep 30, 2020 at 11:46:16AM +0200, Pali Rohár wrote:
> > > On Wednesday 30 September 2020 11:20:43 Greg Kroah-Hartman wrote:
> > > > On Wed, Sep 30, 2020 at 10:25:34AM +0200, Pali Rohár wrote:
> > > > > On Wednesday 30 September 2020 10:02:05 Greg Kroah-Hartman wrote:
> > > > > > On Tue, Sep 29, 2020 at 11:32:54PM +0200, Pali Rohár wrote:
> > > > > > > CCing other lists and maintainers, hopefully, somebody would have a time to look at it...
> > > > > > > 
> > > > > > > On Saturday 08 August 2020 15:27:47 Pali Rohár wrote:
> > > > > > > > On Wednesday 15 April 2020 00:56:18 Pali Rohár wrote:
> > > > > > > > > On Sunday 09 February 2020 14:21:37 Pali Rohár wrote:
> > > > > > > > > > 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?
> > > > > > > > > 
> > > > > > > > > Hello!
> > > > > > > > > 
> > > > > > > > > I have not got any answer to my email from Marcel for months, so I'm
> > > > > > > > > adding other developers to loop. Could somebody tell me that is the
> > > > > > > > > replacement API if above one is going to be removed?
> > > > > > > > > 
> > > > > > > > > I was not able to find any documentation where could be described this
> > > > > > > > > API nor information about deprecation / removal.
> > > > > > > > > 
> > > > > > > > > And are you aware of the fact that removing of API could potentially
> > > > > > > > > break existing applications?
> > > > > > > > > 
> > > > > > > > > I really need to know which API should I use, because when I use API
> > > > > > > > > which is going to be removed, then my application stops working. And I
> > > > > > > > > really want to avoid it.
> > > > > > > > > 
> > > > > > > > > Also I have not got any response yet, how can I read list of supported
> > > > > > > > > codecs by bluetooth adapter by ordinary non-root user? Audio application
> > > > > > > > > needs to know list of supported codecs and it is really insane to run it
> > > > > > > > > as root.
> > > > > > > > 
> > > > > > > > Hello! This is just another reminder that I have not got any reply to
> > > > > > > > this email.
> > > > > > > > 
> > > > > > > > Does silence mean that audio applications are expected to work only
> > > > > > > > under root account and ordinary users are not able to use audio and list
> > > > > > > > supported codecs?
> > > > > > > 
> > > > > > > Hello! I have not got any reply for this issue for 10 months and if you
> > > > > > > are going to remove (or after these 10 months you already did it?)
> > > > > > > existing HCI API from kernel it would break existing and working
> > > > > > > userspace application. How do you want to handle such regressions?
> > > > > > 
> > > > > > What git commit caused this regression?
> > > > > 
> > > > > Hello! Marcel in January wrote that access for HCI commands is being
> > > > > removed from kernel. I do not know if he managed to do it in since
> > > > > January, but I'm going to check it...
> > > > 
> > > > So you don't see a regression/problem, but are saying there is one?
> > > 
> > > Hello!
> > > 
> > > Planed removal of used API would be a regression. Marcel wrote that it
> > > is "being removed". Nobody reacted to that fact for 10 months so I did
> > > not know if this comment was lost and removal is already in progress.
> > > Or if something was changed and removal is not planned anymore.
> > > 
> > > So are you aware that it will break applications?
> > 
> > Does it?
> 
> Of course.
> 
> > > > odd...
> > > 
> > > I think it is not a good idea to do something and then check what happen
> > > if there are people who know that such thing is in use and for sure it
> > > will break something.
> > > 
> > > And also I still did not get any response what is the replacement of
> > > that API.
> > 
> > It sounds like only new commands are restricted
> 
> So existing are not being removed? It was finally changed and can you confirm it?

I think you need to point us at some kernel git commits that you are
saying is causing problems here, as it's too confusing to determine what
is really happening here.

thanks,

greg k-h

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

* Re: Removal of HCI commands, userspace bluetooth regression?
  2020-09-30 11:20                         ` Greg Kroah-Hartman
@ 2020-09-30 11:51                           ` Pali Rohár
  2020-09-30 12:02                             ` Greg Kroah-Hartman
  0 siblings, 1 reply; 19+ messages in thread
From: Pali Rohár @ 2020-09-30 11:51 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Marcel Holtmann, Johan Hedberg, David S. Miller, Jakub Kicinski,
	Pavel Machek, Luiz Augusto von Dentz, Sebastian Reichel,
	David Heidelberg, Linus Torvalds, linux-bluetooth, netdev,
	linux-kernel

On Wednesday 30 September 2020 13:20:06 Greg Kroah-Hartman wrote:
> On Wed, Sep 30, 2020 at 01:00:13PM +0200, Pali Rohár wrote:
> > On Wednesday 30 September 2020 12:54:34 Greg Kroah-Hartman wrote:
> > > On Wed, Sep 30, 2020 at 11:46:16AM +0200, Pali Rohár wrote:
> > > > On Wednesday 30 September 2020 11:20:43 Greg Kroah-Hartman wrote:
> > > > > On Wed, Sep 30, 2020 at 10:25:34AM +0200, Pali Rohár wrote:
> > > > > > On Wednesday 30 September 2020 10:02:05 Greg Kroah-Hartman wrote:
> > > > > > > On Tue, Sep 29, 2020 at 11:32:54PM +0200, Pali Rohár wrote:
> > > > > > > > CCing other lists and maintainers, hopefully, somebody would have a time to look at it...
> > > > > > > > 
> > > > > > > > On Saturday 08 August 2020 15:27:47 Pali Rohár wrote:
> > > > > > > > > On Wednesday 15 April 2020 00:56:18 Pali Rohár wrote:
> > > > > > > > > > On Sunday 09 February 2020 14:21:37 Pali Rohár wrote:
> > > > > > > > > > > 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?
> > > > > > > > > > 
> > > > > > > > > > Hello!
> > > > > > > > > > 
> > > > > > > > > > I have not got any answer to my email from Marcel for months, so I'm
> > > > > > > > > > adding other developers to loop. Could somebody tell me that is the
> > > > > > > > > > replacement API if above one is going to be removed?
> > > > > > > > > > 
> > > > > > > > > > I was not able to find any documentation where could be described this
> > > > > > > > > > API nor information about deprecation / removal.
> > > > > > > > > > 
> > > > > > > > > > And are you aware of the fact that removing of API could potentially
> > > > > > > > > > break existing applications?
> > > > > > > > > > 
> > > > > > > > > > I really need to know which API should I use, because when I use API
> > > > > > > > > > which is going to be removed, then my application stops working. And I
> > > > > > > > > > really want to avoid it.
> > > > > > > > > > 
> > > > > > > > > > Also I have not got any response yet, how can I read list of supported
> > > > > > > > > > codecs by bluetooth adapter by ordinary non-root user? Audio application
> > > > > > > > > > needs to know list of supported codecs and it is really insane to run it
> > > > > > > > > > as root.
> > > > > > > > > 
> > > > > > > > > Hello! This is just another reminder that I have not got any reply to
> > > > > > > > > this email.
> > > > > > > > > 
> > > > > > > > > Does silence mean that audio applications are expected to work only
> > > > > > > > > under root account and ordinary users are not able to use audio and list
> > > > > > > > > supported codecs?
> > > > > > > > 
> > > > > > > > Hello! I have not got any reply for this issue for 10 months and if you
> > > > > > > > are going to remove (or after these 10 months you already did it?)
> > > > > > > > existing HCI API from kernel it would break existing and working
> > > > > > > > userspace application. How do you want to handle such regressions?
> > > > > > > 
> > > > > > > What git commit caused this regression?
> > > > > > 
> > > > > > Hello! Marcel in January wrote that access for HCI commands is being
> > > > > > removed from kernel. I do not know if he managed to do it in since
> > > > > > January, but I'm going to check it...
> > > > > 
> > > > > So you don't see a regression/problem, but are saying there is one?
> > > > 
> > > > Hello!
> > > > 
> > > > Planed removal of used API would be a regression. Marcel wrote that it
> > > > is "being removed". Nobody reacted to that fact for 10 months so I did
> > > > not know if this comment was lost and removal is already in progress.
> > > > Or if something was changed and removal is not planned anymore.
> > > > 
> > > > So are you aware that it will break applications?
> > > 
> > > Does it?
> > 
> > Of course.
> > 
> > > > > odd...
> > > > 
> > > > I think it is not a good idea to do something and then check what happen
> > > > if there are people who know that such thing is in use and for sure it
> > > > will break something.
> > > > 
> > > > And also I still did not get any response what is the replacement of
> > > > that API.
> > > 
> > > It sounds like only new commands are restricted
> > 
> > So existing are not being removed? It was finally changed and can you confirm it?
> 
> I think you need to point us at some kernel git commits that you are
> saying is causing problems here, as it's too confusing to determine what
> is really happening here.

Ok, to recap:

Problem is causing [1] the fact that "direct access to HCI commands is
being removed" as was written in first reply of this email thread.

I asked more times [2] [3] [4] [5] what is replacement for this API
(direct access to HCI commands) and what should userspace application
use instead of that API and how it impact existing application which
uses that API, but nobody answered yet.

The next problem which I described in [0] is that command for listing
supported audio codes via that direct access API is not allowed by
non-root user and therefore audio application needs to be running under
root user. In [2] [3] [4] [5] I asked what should userspace application
do for listing these supported codecs, but again nobody answered.

So based on [1] (the only answer) "direct access to HCI commands is
being removed" and I deduced that existing application which uses this
API stops working after kernel removes that API.

Also as I have not figured out and nobody answered how to list supported
audio codecs, the only current way is to use "API which is being
removed" ([1]) from root user (due to [0]). And because nobody answered
these questions for 10 months (I reminded it more times [2] [3] [4] [5])
I started using this "API which is being removed" in my new applications
[6] and forcing requirement of usage of root user.

Greg, it is clear now? Or do you need more details? (If yes, which)?

For any future userspace development I need to know answers to these
questions:

 o When is that API for "direct access to HCI command" going to be
   completely removed? Is there transitional period?

 o What is replacement for that API?

 o If it is really going to be completely removed, how regressions would
   be handled? There are existing applications which use it and after
   removal, they would be broken.

 o What would ensure that my new applications which use that API stay
   working?

 o Why must kernel block non-root users to list supported audio codecs
   by bluetooth adapters? Does it mean that bluetooth audio applications
   are forced to be run as root on Linux kernel forever?


[0] - https://lore.kernel.org/linux-bluetooth/20191228171212.56anj4d4kvjeqhms@pali/
[1] - https://lore.kernel.org/linux-bluetooth/45BB2908-4E16-4C74-9DB4-8BAD93B42A21@holtmann.org/
[2] - https://lore.kernel.org/linux-bluetooth/20200104102436.bhqagqrfwupj6hkm@pali/
[3] - https://lore.kernel.org/linux-bluetooth/20200209132137.7pi4pgnassosh3ax@pali/
[4] - https://lore.kernel.org/linux-bluetooth/20200414225618.zgh5h4jexahfukdl@pali/
[5] - https://lore.kernel.org/linux-bluetooth/20200808132747.4byefjg5ysddgkel@pali/
[6] - https://github.com/pali/hsphfpd-prototype

> 
> thanks,
> 
> greg k-h

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

* Re: Removal of HCI commands, userspace bluetooth regression?
  2020-09-30 11:51                           ` Pali Rohár
@ 2020-09-30 12:02                             ` Greg Kroah-Hartman
  0 siblings, 0 replies; 19+ messages in thread
From: Greg Kroah-Hartman @ 2020-09-30 12:02 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Marcel Holtmann, Johan Hedberg, David S. Miller, Jakub Kicinski,
	Pavel Machek, Luiz Augusto von Dentz, Sebastian Reichel,
	David Heidelberg, Linus Torvalds, linux-bluetooth, netdev,
	linux-kernel

On Wed, Sep 30, 2020 at 01:51:32PM +0200, Pali Rohár wrote:
> On Wednesday 30 September 2020 13:20:06 Greg Kroah-Hartman wrote:
> > On Wed, Sep 30, 2020 at 01:00:13PM +0200, Pali Rohár wrote:
> > > On Wednesday 30 September 2020 12:54:34 Greg Kroah-Hartman wrote:
> > > > On Wed, Sep 30, 2020 at 11:46:16AM +0200, Pali Rohár wrote:
> > > > > On Wednesday 30 September 2020 11:20:43 Greg Kroah-Hartman wrote:
> > > > > > On Wed, Sep 30, 2020 at 10:25:34AM +0200, Pali Rohár wrote:
> > > > > > > On Wednesday 30 September 2020 10:02:05 Greg Kroah-Hartman wrote:
> > > > > > > > On Tue, Sep 29, 2020 at 11:32:54PM +0200, Pali Rohár wrote:
> > > > > > > > > CCing other lists and maintainers, hopefully, somebody would have a time to look at it...
> > > > > > > > > 
> > > > > > > > > On Saturday 08 August 2020 15:27:47 Pali Rohár wrote:
> > > > > > > > > > On Wednesday 15 April 2020 00:56:18 Pali Rohár wrote:
> > > > > > > > > > > On Sunday 09 February 2020 14:21:37 Pali Rohár wrote:
> > > > > > > > > > > > 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?
> > > > > > > > > > > 
> > > > > > > > > > > Hello!
> > > > > > > > > > > 
> > > > > > > > > > > I have not got any answer to my email from Marcel for months, so I'm
> > > > > > > > > > > adding other developers to loop. Could somebody tell me that is the
> > > > > > > > > > > replacement API if above one is going to be removed?
> > > > > > > > > > > 
> > > > > > > > > > > I was not able to find any documentation where could be described this
> > > > > > > > > > > API nor information about deprecation / removal.
> > > > > > > > > > > 
> > > > > > > > > > > And are you aware of the fact that removing of API could potentially
> > > > > > > > > > > break existing applications?
> > > > > > > > > > > 
> > > > > > > > > > > I really need to know which API should I use, because when I use API
> > > > > > > > > > > which is going to be removed, then my application stops working. And I
> > > > > > > > > > > really want to avoid it.
> > > > > > > > > > > 
> > > > > > > > > > > Also I have not got any response yet, how can I read list of supported
> > > > > > > > > > > codecs by bluetooth adapter by ordinary non-root user? Audio application
> > > > > > > > > > > needs to know list of supported codecs and it is really insane to run it
> > > > > > > > > > > as root.
> > > > > > > > > > 
> > > > > > > > > > Hello! This is just another reminder that I have not got any reply to
> > > > > > > > > > this email.
> > > > > > > > > > 
> > > > > > > > > > Does silence mean that audio applications are expected to work only
> > > > > > > > > > under root account and ordinary users are not able to use audio and list
> > > > > > > > > > supported codecs?
> > > > > > > > > 
> > > > > > > > > Hello! I have not got any reply for this issue for 10 months and if you
> > > > > > > > > are going to remove (or after these 10 months you already did it?)
> > > > > > > > > existing HCI API from kernel it would break existing and working
> > > > > > > > > userspace application. How do you want to handle such regressions?
> > > > > > > > 
> > > > > > > > What git commit caused this regression?
> > > > > > > 
> > > > > > > Hello! Marcel in January wrote that access for HCI commands is being
> > > > > > > removed from kernel. I do not know if he managed to do it in since
> > > > > > > January, but I'm going to check it...
> > > > > > 
> > > > > > So you don't see a regression/problem, but are saying there is one?
> > > > > 
> > > > > Hello!
> > > > > 
> > > > > Planed removal of used API would be a regression. Marcel wrote that it
> > > > > is "being removed". Nobody reacted to that fact for 10 months so I did
> > > > > not know if this comment was lost and removal is already in progress.
> > > > > Or if something was changed and removal is not planned anymore.
> > > > > 
> > > > > So are you aware that it will break applications?
> > > > 
> > > > Does it?
> > > 
> > > Of course.
> > > 
> > > > > > odd...
> > > > > 
> > > > > I think it is not a good idea to do something and then check what happen
> > > > > if there are people who know that such thing is in use and for sure it
> > > > > will break something.
> > > > > 
> > > > > And also I still did not get any response what is the replacement of
> > > > > that API.
> > > > 
> > > > It sounds like only new commands are restricted
> > > 
> > > So existing are not being removed? It was finally changed and can you confirm it?
> > 
> > I think you need to point us at some kernel git commits that you are
> > saying is causing problems here, as it's too confusing to determine what
> > is really happening here.
> 
> Ok, to recap:
> 
> Problem is causing [1] the fact that "direct access to HCI commands is
> being removed" as was written in first reply of this email thread.

But I don't see those commits anywhere in the tree, so nothing has
actually been removed yet?

That's what I'm asking, what has regressed?  If nothing, then there's no
problem :)

If people are considering changing things, well, work on that, and
object to any patches that break existing tools.  But I don't see that
at the moment, so what can I do?

thanks,

greg k-h

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

end of thread, other threads:[~2020-09-30 12:02 UTC | newest]

Thread overview: 19+ 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
2020-04-14 22:56       ` Removal of HCI commands? (Was: Re: OCF_READ_LOCAL_CODECS is permitted only for root user) Pali Rohár
2020-08-08 13:27         ` Pali Rohár
2020-09-29 21:32           ` Removal of HCI commands, userspace bluetooth regression? Pali Rohár
2020-09-30  8:02             ` Greg Kroah-Hartman
2020-09-30  8:16               ` Marcel Holtmann
2020-09-30  9:20                 ` Greg Kroah-Hartman
2020-09-30  9:49                   ` Pali Rohár
2020-09-30  8:25               ` Pali Rohár
2020-09-30  9:20                 ` Greg Kroah-Hartman
2020-09-30  9:46                   ` Pali Rohár
2020-09-30 10:54                     ` Greg Kroah-Hartman
2020-09-30 11:00                       ` Pali Rohár
2020-09-30 11:20                         ` Greg Kroah-Hartman
2020-09-30 11:51                           ` Pali Rohár
2020-09-30 12:02                             ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).