linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Bluez-devel] [Patch] Samsung D600 (sdp, service discovery deadlocks)
@ 2005-11-22 20:39 Victor Shchebatyuk
  2005-11-24  4:22 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Victor Shchebatyuk @ 2005-11-22 20:39 UTC (permalink / raw)
  To: BlueZ Mailing List

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

Hi Marcel,

We experienced some deadlock in the bluez library for Samsund-D600 phone
during service discovery. This is due to incorrect SDP record set
returned on service inquiry request. The response from the SDP server
contains service records + some rubbish at the end. So when it tries to
parse it, sdp_extract_pdu() returns 0 recsize and locks the while()
loop.
Samsung is informed, but I do not know if they will come up with
something (have no idea who provides the stack for them, they have a
Broadcom chip in there)

The patch is attached.

Regards,
    Victor.

P.S. I do not have the phone with me now, otherwise I would send in
hcidump output. It reports errors when trying to parse at the end of
response.

[-- Attachment #2: sdp-samsungd600.patch --]
[-- Type: text/x-patch, Size: 444 bytes --]

Index: src/sdp.c
===================================================================
RCS file: /cvsroot/bluez/libs/src/sdp.c,v
retrieving revision 1.30
diff -u -r1.30 sdp.c
--- src/sdp.c	29 Oct 2005 19:25:43 -0000	1.30
+++ src/sdp.c	22 Nov 2005 20:24:12 -0000
@@ -3115,6 +3115,10 @@
 					status = -1;
 					goto end;
 				}
+				if (!recsize) {
+					sdp_record_free(rec);
+					break;
+				}
 				scanned += recsize;
 				pdata += recsize;
 

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

end of thread, other threads:[~2005-11-24  4:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-22 20:39 [Bluez-devel] [Patch] Samsung D600 (sdp, service discovery deadlocks) Victor Shchebatyuk
2005-11-24  4:22 ` Marcel Holtmann

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).