linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug in net/bluetooth/a2mp.c
@ 2021-01-13  8:32 Schmid, Carsten
       [not found] ` <ab4d664d-5ff8-498b-89b4-35eff3b95010@www.fastmail.com>
  0 siblings, 1 reply; 2+ messages in thread
From: Schmid, Carsten @ 2021-01-13  8:32 UTC (permalink / raw)
  To: marcel, luiz.dentz; +Cc: linux-bluetooth

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* AW: Bug in net/bluetooth/a2mp.c
       [not found] ` <ab4d664d-5ff8-498b-89b4-35eff3b95010@www.fastmail.com>
@ 2021-01-13  9:30   ` Schmid, Carsten
  0 siblings, 0 replies; 2+ messages in thread
From: Schmid, Carsten @ 2021-01-13  9:30 UTC (permalink / raw)
  To: Christopher William Snowhill, Marcel Holtmann, luiz.dentz; +Cc: linux-bluetooth

> Yes. I submitted a patch that corrects this, and it has already been accepted into bluetooth-next. It has not made it into any kernels yet.

Thanks for notifying me.

BR
Carsten
-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-13  9:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-13  8:32 Bug in net/bluetooth/a2mp.c Schmid, Carsten
     [not found] ` <ab4d664d-5ff8-498b-89b4-35eff3b95010@www.fastmail.com>
2021-01-13  9:30   ` AW: " Schmid, Carsten

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).