All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH v2] Bluetooth: MGTM: Fix slab-out-of-bounds in tlv_data_is_valid
Date: Wed, 2 Jun 2021 21:52:16 +0200	[thread overview]
Message-ID: <10093E2D-8238-448E-8E90-5B2851B85BCB@holtmann.org> (raw)
In-Reply-To: <20210528184502.171731-1-luiz.dentz@gmail.com>

Hi Luiz,

> This fixes parsing of LTV entries when the length is 0.
> 
> Found with:
> 
> tools/mgmt-tester -s "Add Advertising - Success (ScRsp only)"
> 
> Add Advertising - Success (ScRsp only) - run
>  Sending Add Advertising (0x003e)
>  Test condition added, total 1
> [   11.004577] ==================================================================
> [   11.005292] BUG: KASAN: slab-out-of-bounds in tlv_data_is_valid+0x87/0xe0
> [   11.005984] Read of size 1 at addr ffff888002c695b0 by task mgmt-tester/87
> [   11.006711]
> [   11.007176]
> [   11.007429] Allocated by task 87:
> [   11.008151]
> [   11.008438] The buggy address belongs to the object at ffff888002c69580
> [   11.008438]  which belongs to the cache kmalloc-64 of size 64
> [   11.010526] The buggy address is located 48 bytes inside of
> [   11.010526]  64-byte region [ffff888002c69580, ffff888002c695c0)
> [   11.012423] The buggy address belongs to the page:
> [   11.013291]
> [   11.013544] Memory state around the buggy address:
> [   11.014359]  ffff888002c69480: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
> [   11.015453]  ffff888002c69500: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
> [   11.016232] >ffff888002c69580: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc
> [   11.017010]                                      ^
> [   11.017547]  ffff888002c69600: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc
> [   11.018296]  ffff888002c69680: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
> [   11.019116] ==================================================================
> 
> Fixes: 2bb36870e8cb2 ("Bluetooth: Unify advertising instance flags check")
> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> ---
> net/bluetooth/mgmt.c | 3 +++
> 1 file changed, 3 insertions(+)

patch has been applied to bluetooth-next tree.

Regards

Marcel


      parent reply	other threads:[~2021-06-02 19:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-28 18:45 Luiz Augusto von Dentz
2021-05-28 20:14 ` [v2] " bluez.test.bot
2021-06-02 19:52 ` Marcel Holtmann [this message]

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=10093E2D-8238-448E-8E90-5B2851B85BCB@holtmann.org \
    --to=marcel@holtmann.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --subject='Re: [PATCH v2] Bluetooth: MGTM: Fix slab-out-of-bounds in tlv_data_is_valid' \
    /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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.