All of lore.kernel.org
 help / color / mirror / Atom feed
From: Victor Shchebatyuk <victor@win.tue.nl>
To: BlueZ Mailing List <bluez-devel@lists.sourceforge.net>
Subject: [Bluez-devel] [Patch] Samsung D600 (sdp, service discovery deadlocks)
Date: Tue, 22 Nov 2005 21:39:30 +0100	[thread overview]
Message-ID: <1132691970.9887.14.camel@localhost.localdomain> (raw)

[-- 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;
 

             reply	other threads:[~2005-11-22 20:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-22 20:39 Victor Shchebatyuk [this message]
2005-11-24  4:22 ` [Bluez-devel] [Patch] Samsung D600 (sdp, service discovery deadlocks) Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1132691970.9887.14.camel@localhost.localdomain \
    --to=victor@win.tue.nl \
    --cc=bluez-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.