2011-10-24 13:14:41

by Daniel Wagner

[permalink] [raw]
Subject: [BUG] Invalid file descriptor.

To whom it might concern,

if bluez is running without an agent and the remote device tries to
connect to bluez you are able to trigger the "Invalid file descriptor".


bluetoothd[30869]: src/event.c:btd_event_bonding_complete() status 0x00
bluetoothd[30869]: src/adapter.c:adapter_get_device() A0:4E:04:F6:F5:05
bluetoothd[30869]: src/device.c:device_bonding_complete() bonding (nil)
status 0x00
bluetoothd[30869]: audio/manager.c:hf_io_cb() Authorization denied!

(bluetoothd:30869): GLib-WARNING **: Invalid file descriptor.

bluetoothd[30869]: plugins/hciops.c:disconn_complete() handle 44 status 0x00
bluetoothd[30869]: src/event.c:btd_event_disconn_complete()
bluetoothd[30869]: src/adapter.c:adapter_remove_connection()


cheers,
daniel

ps: I was told to report all crashes and bugs I find. Be prepared. I am
a very capable finding bugs :)


2011-10-24 13:42:37

by Daniel Wagner

[permalink] [raw]
Subject: Re: [BUG] Invalid file descriptor.

On 10/24/2011 03:36 PM, Luiz Augusto von Dentz wrote:
> Hi Daniel,
>
> On Mon, Oct 24, 2011 at 4:23 PM, Daniel Wagner<[email protected]> wrote:
>>>
>>> What about the patch?
>>
>> Sure, I will do as soon I have fixed all outstanding ConnMan bugs I found
>> just recently. In other words don't expect very soon this patch :)
>
> Try with this:
>
> diff --git a/audio/manager.c b/audio/manager.c
> index 818451c..3103824 100644
> --- a/audio/manager.c
> +++ b/audio/manager.c
> @@ -607,7 +607,6 @@ static void hf_io_cb(GIOChannel *chan, gpointer data)
> if (perr< 0) {
> DBG("Authorization denied!");
> gateway_set_state(device, GATEWAY_STATE_DISCONNECTED);
> - goto drop;
> }
>
> return;
>

Yes, that fixes the error message.

Thanks,
daniel

2011-10-24 13:39:59

by Lucas De Marchi

[permalink] [raw]
Subject: Re: [BUG] Invalid file descriptor.

Hi Luiz,

On Mon, Oct 24, 2011 at 11:36 AM, Luiz Augusto von Dentz
<[email protected]> wrote:
> Hi Daniel,
>
> On Mon, Oct 24, 2011 at 4:23 PM, Daniel Wagner <[email protected]> wrote:
>>>
>>> What about the patch?
>>
>> Sure, I will do as soon I have fixed all outstanding ConnMan bugs I found
>> just recently. In other words don't expect very soon this patch :)
>
> Try with this:
>
> diff --git a/audio/manager.c b/audio/manager.c
> index 818451c..3103824 100644
> --- a/audio/manager.c
> +++ b/audio/manager.c
> @@ -607,7 +607,6 @@ static void hf_io_cb(GIOChannel *chan, gpointer data)
> ? ? ? ?if (perr < 0) {
> ? ? ? ? ? ? ? ?DBG("Authorization denied!");
> ? ? ? ? ? ? ? ?gateway_set_state(device, GATEWAY_STATE_DISCONNECTED);
> - ? ? ? ? ? ? ? goto drop;
> ? ? ? ?}

It seems correct. As far as I remember there are similar problems in
other profiles like input /manager.c.


Lucas De Marchi

2011-10-24 13:36:06

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [BUG] Invalid file descriptor.

Hi Daniel,

On Mon, Oct 24, 2011 at 4:23 PM, Daniel Wagner <[email protected]> wrote:
>>
>> What about the patch?
>
> Sure, I will do as soon I have fixed all outstanding ConnMan bugs I found
> just recently. In other words don't expect very soon this patch :)

Try with this:

diff --git a/audio/manager.c b/audio/manager.c
index 818451c..3103824 100644
--- a/audio/manager.c
+++ b/audio/manager.c
@@ -607,7 +607,6 @@ static void hf_io_cb(GIOChannel *chan, gpointer data)
if (perr < 0) {
DBG("Authorization denied!");
gateway_set_state(device, GATEWAY_STATE_DISCONNECTED);
- goto drop;
}

return;

--
Luiz Augusto von Dentz

2011-10-24 13:23:08

by Daniel Wagner

[permalink] [raw]
Subject: Re: [BUG] Invalid file descriptor.

Hi Lucas,

On 10/24/2011 03:19 PM, Lucas De Marchi wrote:
> On Mon, Oct 24, 2011 at 11:14 AM, Daniel Wagner<[email protected]> wrote:
>> To whom it might concern,
>>
>> if bluez is running without an agent and the remote device tries to connect
>> to bluez you are able to trigger the "Invalid file descriptor".
>>
>>
>> bluetoothd[30869]: src/event.c:btd_event_bonding_complete() status 0x00
>> bluetoothd[30869]: src/adapter.c:adapter_get_device() A0:4E:04:F6:F5:05
>> bluetoothd[30869]: src/device.c:device_bonding_complete() bonding (nil)
>> status 0x00
>> bluetoothd[30869]: audio/manager.c:hf_io_cb() Authorization denied!
>>
>> (bluetoothd:30869): GLib-WARNING **: Invalid file descriptor.
>>
>> bluetoothd[30869]: plugins/hciops.c:disconn_complete() handle 44 status 0x00
>> bluetoothd[30869]: src/event.c:btd_event_disconn_complete()
>> bluetoothd[30869]: src/adapter.c:adapter_remove_connection()
>>
>>
>> cheers,
>> daniel
>>
>> ps: I was told to report all crashes and bugs I find. Be prepared. I am a
>> very capable finding bugs :)
>
> What about the patch?

Sure, I will do as soon I have fixed all outstanding ConnMan bugs I
found just recently. In other words don't expect very soon this patch :)

cheers,
daniel

2011-10-24 13:19:19

by Lucas De Marchi

[permalink] [raw]
Subject: Re: [BUG] Invalid file descriptor.

Hi Daniel,

On Mon, Oct 24, 2011 at 11:14 AM, Daniel Wagner <[email protected]> wrote:
> To whom it might concern,
>
> if bluez is running without an agent and the remote device tries to connect
> to bluez you are able to trigger the "Invalid file descriptor".
>
>
> bluetoothd[30869]: src/event.c:btd_event_bonding_complete() status 0x00
> bluetoothd[30869]: src/adapter.c:adapter_get_device() A0:4E:04:F6:F5:05
> bluetoothd[30869]: src/device.c:device_bonding_complete() bonding (nil)
> status 0x00
> bluetoothd[30869]: audio/manager.c:hf_io_cb() Authorization denied!
>
> (bluetoothd:30869): GLib-WARNING **: Invalid file descriptor.
>
> bluetoothd[30869]: plugins/hciops.c:disconn_complete() handle 44 status 0x00
> bluetoothd[30869]: src/event.c:btd_event_disconn_complete()
> bluetoothd[30869]: src/adapter.c:adapter_remove_connection()
>
>
> cheers,
> daniel
>
> ps: I was told to report all crashes and bugs I find. Be prepared. I am a
> very capable finding bugs :)

What about the patch?


Lucas De Marchi