lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 11 Nov 2020 00:18:52 -0500
From:   Peilin Ye <yepeilin.cs@...il.com>
To:     Marcel Holtmann <marcel@...tmann.org>
Cc:     Johan Hedberg <johan.hedberg@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Bluez mailing list <linux-bluetooth@...r.kernel.org>,
        "open list:NETWORKING [GENERAL]" <netdev@...r.kernel.org>,
        linux-kernel-mentees@...ts.linuxfoundation.org,
        linux-kernel@...r.kernel.org
Subject: Re: [Linux-kernel-mentees] [PATCH net v2] Bluetooth: Fix
 slab-out-of-bounds read in hci_le_direct_adv_report_evt()

On Mon, Nov 09, 2020 at 01:16:53PM +0100, Marcel Holtmann wrote:
> Hi Peilin,
> 
> > `num_reports` is not being properly checked. A malformed event packet with
> > a large `num_reports` number makes hci_le_direct_adv_report_evt() read out
> > of bounds. Fix it.
> > 
> > Cc: stable@...r.kernel.org
> > Fixes: 2f010b55884e ("Bluetooth: Add support for handling LE Direct Advertising Report events")
> > Reported-and-tested-by: syzbot+24ebd650e20bd263ca01@...kaller.appspotmail.com
> > Link: https://syzkaller.appspot.com/bug?extid=24ebd650e20bd263ca01
> > Signed-off-by: Peilin Ye <yepeilin.cs@...il.com>
> > ---
> > Change in v2:
> >    - add "Cc: stable@" tag.
> > 
> > net/bluetooth/hci_event.c | 12 +++++-------
> > 1 file changed, 5 insertions(+), 7 deletions(-)
> > 
> > diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
> > index 4b7fc430793c..aec43ae488d1 100644
> > --- a/net/bluetooth/hci_event.c
> > +++ b/net/bluetooth/hci_event.c
> > @@ -5863,21 +5863,19 @@ static void hci_le_direct_adv_report_evt(struct hci_dev *hdev,
> > 					 struct sk_buff *skb)
> > {
> > 	u8 num_reports = skb->data[0];
> > -	void *ptr = &skb->data[1];
> > +	struct hci_ev_le_direct_adv_info *ev = (void *)&skb->data[1];
> > 
> > -	hci_dev_lock(hdev);
> > +	if (!num_reports || skb->len < num_reports * sizeof(*ev) + 1)
> > +		return;
> > 
> > -	while (num_reports--) {
> > -		struct hci_ev_le_direct_adv_info *ev = ptr;
> > +	hci_dev_lock(hdev);
> > 
> > +	for (; num_reports; num_reports--, ev++)
> > 		process_adv_report(hdev, ev->evt_type, &ev->bdaddr,
> > 				   ev->bdaddr_type, &ev->direct_addr,
> > 				   ev->direct_addr_type, ev->rssi, NULL, 0,
> > 				   false);
> > 
> > -		ptr += sizeof(*ev);
> > -	}
> > -
> > 	hci_dev_unlock(hdev);
> > }
> 
> patch has been applied to bluetooth-next tree.

Thank you for reviewing it,

Peilin Ye

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ