From: Matias Karhumaa <matias.karhumaa@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH v2] obexd: Fix null pointer dereference.
Date: Thu, 22 Jun 2017 13:50:23 +0300 [thread overview]
Message-ID: <20170622105020.GA5388@makarhum-e6330> (raw)
By sending OPP Put request before CONNECT we were able to cause
SIGSEGV in obexd. Crash was caused by null pointer dereference.
Crash was found using Synopsys Defensics Obex Server test suite.
This was fixed by calling os->service->connect if CONNECT was not
done before.
---
obexd/src/obex.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/obexd/src/obex.c b/obexd/src/obex.c
index 788bffc..be79a77 100644
--- a/obexd/src/obex.c
+++ b/obexd/src/obex.c
@@ -864,6 +864,17 @@ static void cmd_put(GObex *obex, GObexPacket *req, gpointer user_data)
return;
}
+ /* OPP session don't require CONNECT, in which case just call connect
+ * callback to register the transfer.
+ */
+ if (!os->service_data && os->service->service == OBEX_OPP) {
+ os->service_data = os->service->connect(os, &err);
+ if (err < 0) {
+ os_set_response(os, err);
+ return;
+ }
+ }
+
parse_type(os, req);
if (os->driver == NULL) {
--
2.7.4
next reply other threads:[~2017-06-22 10:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-22 10:50 Matias Karhumaa [this message]
2017-06-22 11:23 ` [PATCH v2] obexd: Fix null pointer dereference Luiz Augusto von Dentz
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=20170622105020.GA5388@makarhum-e6330 \
--to=matias.karhumaa@gmail.com \
--cc=linux-bluetooth@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox