[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABBYNZKiNBxqZbS7hcBrpiwHRRwAe9gXvHWNvi63qBfykR=SVg@mail.gmail.com>
Date: Tue, 8 Oct 2024 10:12:34 -0400
From: Luiz Augusto von Dentz <luiz.dentz@...il.com>
To: Edward Adam Davis <eadavis@...com>
Cc: syzbot+6ea290ba76d8c1eb1ac2@...kaller.appspotmail.com,
johan.hedberg@...il.com, linux-bluetooth@...r.kernel.org,
linux-kernel@...r.kernel.org, marcel@...tmann.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [PATCH] Bluetooth: hci_core: remove acl hdr handle error message
Hi Edward,
On Tue, Oct 8, 2024 at 6:47 AM Edward Adam Davis <eadavis@...com> wrote:
>
> Syzbot reported a uninit-value in hci_rx_work.This is because l2cap didn't
> execute the corresponding connection request to call l2cap_send_cmd() or
> l2cap_do_send(), and ultimately called hci_add_acl_hdr() to set hdr->handle.
What are you talking about here, what these functions have to do with
a local handle variable?
> Therefore, when calling the thread callback function hci_rx_work() to call
> hci_acldata_packet, hdr->handle should not be used directly.
It is not being used directly, the handle is a local variable which
get assigned:
handle = __le16_to_cpu(hdr->handle);
If what you are saying is that there is no guarantee that skb->len >=
HCI_ACL_HDR_SIZE then we probably want to replace skb_pull with
skb_pull_data.
> Reported-and-tested-by: syzbot+6ea290ba76d8c1eb1ac2@...kaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=6ea290ba76d8c1eb1ac2
> Signed-off-by: Edward Adam Davis <eadavis@...com>
> ---
> net/bluetooth/hci_core.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
> index d6976db02c06..20605a7f3f4e 100644
> --- a/net/bluetooth/hci_core.c
> +++ b/net/bluetooth/hci_core.c
> @@ -3791,8 +3791,7 @@ static void hci_acldata_packet(struct hci_dev *hdev, struct sk_buff *skb)
> l2cap_recv_acldata(conn, skb, flags);
> return;
> } else {
> - bt_dev_err(hdev, "ACL packet for unknown connection handle %d",
> - handle);
> + bt_dev_err(hdev, "ACL packet for unknown connection handle");
> }
>
> kfree_skb(skb);
> --
> 2.43.0
>
--
Luiz Augusto von Dentz
Powered by blists - more mailing lists