From: "Schmid, Carsten" <Carsten_Schmid@mentor.com>
To: "marcel@holtmann.org" <marcel@holtmann.org>,
"luiz.dentz@gmail.com" <luiz.dentz@gmail.com>
Cc: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: Bug in net/bluetooth/a2mp.c
Date: Wed, 13 Jan 2021 08:32:04 +0000 [thread overview]
Message-ID: <77dfd0e11ade47afaafdc85d276e653b@SVR-IES-MBX-03.mgc.mentorg.com> (raw)
Hi Marcel, Luis,
i just backported your patch
eddb7732119d53400f48a02536a84c509692faa8 Bluetooth: A2MP: Fix not initializing all members
into our project kernel, and a reviewer has found a bug:
@@ -376,6 +383,8 @@ static int a2mp_getampassoc_req(struct amp_mgr *mgr, struct sk_buff *skb,
struct a2mp_amp_assoc_rsp rsp;
rsp.id = req->id;
+memset(&rsp, 0, sizeof(rsp));
+
if (tmp) {
rsp.status = A2MP_STATUS_COLLISION_OCCURED;
amp_mgr_put(tmp);
Here, rsp.id is set to req->id but then zeroed with memset.
Two hunks above in the same patch this is done in reverse order:
@@ -305,6 +308,8 @@ static int a2mp_getinfo_req(struct amp_mgr *mgr, struct sk_buff *skb,
if (!hdev || hdev->dev_type != HCI_AMP) {
struct a2mp_info_rsp rsp;
+memset(&rsp, 0, sizeof(rsp));
+
rsp.id = req->id;
rsp.status = A2MP_STATUS_INVALID_CTRL_ID;
I assume this is the correct way.
Could this lead to bluetooth malfunctioning, and needs to be patched? Shall i prepare a patch?
Best regards
Carsten
-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter
next reply other threads:[~2021-01-13 8:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-13 8:32 Schmid, Carsten [this message]
[not found] ` <ab4d664d-5ff8-498b-89b4-35eff3b95010@www.fastmail.com>
2021-01-13 9:30 ` AW: Bug in net/bluetooth/a2mp.c Schmid, Carsten
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=77dfd0e11ade47afaafdc85d276e653b@SVR-IES-MBX-03.mgc.mentorg.com \
--to=carsten_schmid@mentor.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--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 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).