From: Hugo Lefeuvre <hle@debian.org>
To: P J P <ppandit@redhat.com>
Cc: "Qemu Developers" <qemu-devel@nongnu.org>,
"Laurent Vivier" <lvivier@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Thomas Huth" <thuth@redhat.com>,
"Prasad J Pandit" <pjp@fedoraproject.org>,
"Arash TC" <tohidi.arash@gmail.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
debian-lts@lists.debian.org
Subject: Re: [Qemu-devel] [PATCH v2] bt: use size_t type for length parameters instead of int
Date: Mon, 28 Jan 2019 10:31:57 +0100 [thread overview]
Message-ID: <20190128093157.GA27483@hle-laptop> (raw)
In-Reply-To: <20181119110757.2692-1-ppandit@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1208 bytes --]
Hi,
> 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.
I'm working on a Debian LTS security update for qemu and am currently
thinking about addressing this issue as well.
I see this patch has not been applied yet and the bluetooth subsystem
is pending deprecation. Are you still considering to apply it?
> @@ -113,6 +113,7 @@ static void vhci_host_send(void *opaque,
> static uint8_t buf[4096];
>
> buf[0] = type;
> + assert(len < sizeof(buf));
> memcpy(buf + 1, data, len);
>
> while (write(s->fd, buf, len + 1) < 0)
Any reason why assert() calls are used here ?
These checks should always be executed, but they won't if user compiles
without asserts. Also, AFAIK any assert failure will stop the qemu host
process which is not what we want in this case.
regards,
Hugo
--
Hugo Lefeuvre (hle) | www.owl.eu.com
RSA4096_ 360B 03B3 BF27 4F4D 7A3F D5E8 14AA 1EB8 A247 3DFD
ed25519_ 37B2 6D38 0B25 B8A2 6B9F 3A65 A36F 5357 5F2D DC4C
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2019-01-28 9:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-19 11:07 [Qemu-devel] [PATCH v2] bt: use size_t type for length parameters instead of int P J P
2018-11-28 7:06 ` P J P
2018-11-28 8:53 ` Thomas Huth
2018-11-28 9:05 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
2019-01-28 9:31 ` Hugo Lefeuvre [this message]
2019-01-28 11:50 ` [Qemu-devel] " Philippe Mathieu-Daudé
2019-01-29 13:13 ` Hugo Lefeuvre
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=20190128093157.GA27483@hle-laptop \
--to=hle@debian.org \
--cc=debian-lts@lists.debian.org \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--cc=pjp@fedoraproject.org \
--cc=ppandit@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
--cc=tohidi.arash@gmail.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).