[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-stable] [PATCH v2] bt: use size_t type for length parameters i
From: |
Thomas Huth |
Subject: |
Re: [Qemu-stable] [PATCH v2] bt: use size_t type for length parameters instead of int |
Date: |
Wed, 28 Nov 2018 09:53:37 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
On 2018-11-19 12:07, P J P wrote:
> From: Prasad J Pandit <address@hidden>
>
> The length parameter values are not negative, thus use an unsigned
> type 'size_t' for them. Many routines pass 'len' values to memcpy(3)
> calls. If it was negative, it could lead to memory corruption issues.
> Add check to avoid it.
>
> Reported-by: Arash TC <address@hidden>
> Signed-off-by: Prasad J Pandit <address@hidden>
> ---
> bt-host.c | 8 +++---
> bt-vhci.c | 7 +++---
> hw/bt/core.c | 2 +-
> hw/bt/hci-csr.c | 32 ++++++++++++------------
> hw/bt/hci.c | 38 ++++++++++++++--------------
> hw/bt/hid.c | 10 ++++----
> hw/bt/l2cap.c | 56 ++++++++++++++++++++++--------------------
> hw/bt/sdp.c | 6 ++---
> hw/usb/dev-bluetooth.c | 12 ++++-----
> include/hw/bt.h | 8 +++---
> include/sysemu/bt.h | 10 ++++----
> 11 files changed, 96 insertions(+), 93 deletions(-)
>
> Update v2: modify assert calls
> -> https://lists.gnu.org/archive/html/qemu-devel/2018-11/msg01036.html
Reviewed-by: Thomas Huth <address@hidden>
Even though it's a rather big patch, I think the changes are trivial
enough so that it could go via qemu-trivial (now on CC:). If not, maybe
Paolo could take it through his "misc" tree?
Thomas
- Re: [Qemu-stable] [PATCH v2] bt: use size_t type for length parameters instead of int,
Thomas Huth <=