From: David Vrabel <david.vrabel@citrix.com>
To: Insu Yun <wuninsu@gmail.com>, <konrad.wilk@oracle.com>,
<boris.ostrovsky@oracle.com>, <Jennifer.Herbert@citrix.com>,
<xen-devel@lists.xenproject.org>, <linux-kernel@vger.kernel.org>
Cc: <taesoo@gatech.edu>, <yeongjin.jang@gatech.edu>,
<insu@gatech.edu>, <changwoo@gatech.edu>
Subject: Re: [PATCH] xen: fix potential integer overflow in queue_reply
Date: Mon, 18 Jan 2016 16:38:01 +0000 [thread overview]
Message-ID: <569D14E9.2050300@citrix.com> (raw)
In-Reply-To: <1453134547-13875-1-git-send-email-wuninsu@gmail.com>
On 18/01/16 16:29, Insu Yun wrote:
> When len is greater than UINT_MAX - sizeof(*rb), in next allocation,
> it can overflow integer range and allocates small size of heap.
> After that, memcpy will overflow the allocated heap.
> Therefore, it needs to check the size of given length.
[...]
> --- a/drivers/xen/xenbus/xenbus_dev_frontend.c
> +++ b/drivers/xen/xenbus/xenbus_dev_frontend.c
> @@ -186,7 +186,7 @@ static int queue_reply(struct list_head *queue, const void *data, size_t len)
> {
> struct read_buffer *rb;
>
> - if (len == 0)
> + if (len == 0 || len >= UINT_MAX - sizeof(*rb))
^^^^^^^^^^^^^^^^^^^^^^
Please check
len > XENSTORE_PAYLOAD_MAX
instead.
David
next prev parent reply other threads:[~2016-01-18 16:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-18 16:29 [PATCH] xen: fix potential integer overflow in queue_reply Insu Yun
2016-01-18 16:38 ` David Vrabel [this message]
2016-01-18 16:47 ` [Xen-devel] " David Vrabel
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=569D14E9.2050300@citrix.com \
--to=david.vrabel@citrix.com \
--cc=Jennifer.Herbert@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=changwoo@gatech.edu \
--cc=insu@gatech.edu \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=taesoo@gatech.edu \
--cc=wuninsu@gmail.com \
--cc=xen-devel@lists.xenproject.org \
--cc=yeongjin.jang@gatech.edu \
/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).