From: Marcel Holtmann <marcel@holtmann.org>
To: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Cc: linux-bluetooth@vger.kernel.org,
Johan Hedberg <johan.hedberg@gmail.com>,
padovan@profusion.mobi,
Waldemar Rymarkiewicz <waldemar.rymarkiewicz@gmail.com>
Subject: Re: [PATCH] Bluetooth: Fix possible NULL pointer dereference
Date: Thu, 22 Sep 2011 11:51:40 +0200 [thread overview]
Message-ID: <1316685104.1937.120.camel@aeonflux> (raw)
In-Reply-To: <1316671092-4387-1-git-send-email-waldemar.rymarkiewicz@tieto.com>
Hi Waldemar,
> Checking conn->pending_sec_level if there is no connection leads to potential
> null pointer dereference. Don't process pin_code_request_event at all if no
> connection exists.
>
> Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@gmail.com>
> ---
> net/bluetooth/hci_event.c | 30 ++++++++++++++++--------------
> 1 files changed, 16 insertions(+), 14 deletions(-)
>
> diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
> index a520787..41c2562 100644
> --- a/net/bluetooth/hci_event.c
> +++ b/net/bluetooth/hci_event.c
> @@ -2175,24 +2175,26 @@ static inline void hci_pin_code_request_evt(struct hci_dev *hdev, struct sk_buff
> hci_dev_lock(hdev);
>
> conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr);
> - if (conn && conn->state == BT_CONNECTED) {
> - hci_conn_hold(conn);
> - conn->disc_timeout = HCI_PAIRING_TIMEOUT;
> - hci_conn_put(conn);
> - }
> + if (conn) {
what is from with this:
if (!conn)
goto unlock;
Regards
Marcel
next prev parent reply other threads:[~2011-09-22 9:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-21 7:08 Bluetooth: Add secure flag for mgmt_pin_code_req Dan Carpenter
2011-09-21 13:17 ` Rymarkiewicz Waldemar
2011-09-22 5:58 ` [PATCH] Bluetooth: Fix possible NULL pointer dereference Waldemar Rymarkiewicz
2011-09-22 9:51 ` Marcel Holtmann [this message]
2011-09-22 10:28 ` Rymarkiewicz Waldemar
2011-09-22 10:58 ` Marcel Holtmann
-- strict thread matches above, loose matches on Subject: below --
2017-06-17 15:45 [PATCH] Bluetooth : " Thomas Gagneret
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=1316685104.1937.120.camel@aeonflux \
--to=marcel@holtmann.org \
--cc=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=padovan@profusion.mobi \
--cc=waldemar.rymarkiewicz@gmail.com \
--cc=waldemar.rymarkiewicz@tieto.com \
/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;
as well as URLs for NNTP newsgroup(s).