mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
To: "Matej Mužila" <mmuzila@redhat.com>
Cc: kys@microsoft.com, devel@linuxdriverproject.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] tools: hv: fcopy_daemon: Check buffer limits
Date: Tue, 21 Oct 2014 13:13:57 +0100	[thread overview]
Message-ID: <20141021131357.3677c4a5@alan.etchedpixels.co.uk> (raw)
In-Reply-To: <5446482C.1000003@redhat.com>

On Tue, 21 Oct 2014 13:49:00 +0200
Matej Mužila <mmuzila@redhat.com> wrote:

> From: Matej Mužila <mmuzila@redhat.com>
> 
> Check if cpmsg->size is in limits of DATA_FRAGMENT
> 
> Signed-off-by: Matej Mužila <mmuzila@redhat.com>
> Acked-by:  K. Y. Srinivasan <kys@microsoft.com>
> ---
> If corrupted data are read from /dev/vmbus/hv_fcopy, pwrite can
> read from memory outside of the buffer (defined at line 138).
> Added check. 
> ---
> @@ -104,6 +104,10 @@ static int hv_copy_data(struct hv_do_fcopy *cpmsg)
>  {
>  	ssize_t bytes_written;
>  
> +	// Check if the cpmsg->size is in limits of DATA_FRAGMENT
> +	if (cpmsg->size > DATA_FRAGMENT * sizeof(__u8))
> +		return HV_E_FAIL;
> +

- C style comments for coding style, also sizeof(__u8) is by definition 1
  so it's perhaps surplus ?

Also your patch block is devoid of a few thins like the file name...

  reply	other threads:[~2014-10-21 12:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-21 11:49 Matej Mužila
2014-10-21 12:13 ` One Thousand Gnomes [this message]
2014-10-21 12:59   ` Matej Mužila
2014-10-21 14:17     ` Dan Carpenter
2014-10-21 14:46     ` [PATCH v2 " Matej Mužila
2014-11-07 18:19       ` Greg KH

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=20141021131357.3677c4a5@alan.etchedpixels.co.uk \
    --to=gnomes@lxorguk.ukuu.org.uk \
    --cc=devel@linuxdriverproject.org \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmuzila@redhat.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

all inboxes | Powered by JetHome®