From: David Vrabel <david.vrabel@csr.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: linux-bluetooth <linux-bluetooth@vger.kernel.org>
Subject: bluetoothd does not check remote names for valid utf8 data
Date: Wed, 25 Aug 2010 15:31:10 +0100 [thread overview]
Message-ID: <4C75292E.9080304@csr.com> (raw)
Hi,
bluetoothd does not check in some (all?) places that the remote name
reported by a device is valid utf8 data. e.g., extract_eir_name() in
src/dbus-hci.c.
The reception of an extended inquiry response containing a name with
invalid utf8 data can cause the dbus interface to disappear. This is
therefore a denial-of-service vulnerability (at the very least).
The following patch fixes the above problem but there are probably other
places where the check needs to be done.
--- bluez-4.51.orig/src/dbus-hci.c
+++ bluez-4.51/src/dbus-hci.c
@@ -450,6 +450,8 @@
switch (*type) {
case 0x08:
case 0x09:
+ if (!g_utf8_validate(data + 2, data[0] - 1, NULL))
+ return strdup("");
return strndup((char *) (data + 2), data[0] - 1);
}
David
--
David Vrabel, Senior Software Engineer, Drivers
CSR, Churchill House, Cambridge Business Park, Tel: +44 (0)1223 692562
Cowley Road, Cambridge, CB4 0WZ http://www.csr.com/
Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
next reply other threads:[~2010-08-25 14:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-25 14:31 David Vrabel [this message]
2010-08-25 15:03 ` bluetoothd does not check remote names for valid utf8 data Johan Hedberg
2010-08-25 21:38 ` Johan Hedberg
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=4C75292E.9080304@csr.com \
--to=david.vrabel@csr.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcel@holtmann.org \
/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.