public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: KY Srinivasan <kys@microsoft.com>
Cc: "olaf@aepfle.de" <olaf@aepfle.de>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"jasowang@redhat.com" <jasowang@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"apw@canonical.com" <apw@canonical.com>,
	"devel@linuxdriverproject.org" <devel@linuxdriverproject.org>
Subject: Re: [PATCH 1/1] Drivers: hv: Implement the file copy service
Date: Fri, 10 Jan 2014 12:40:15 +0300	[thread overview]
Message-ID: <20140110094015.GU30234@mwanda> (raw)
In-Reply-To: <1f59f9753bec413888cc96972e0f2dd2@BY2PR03MB299.namprd03.prod.outlook.com>

On Thu, Jan 09, 2014 at 09:05:05PM +0000, KY Srinivasan wrote:
> > 
> > We've had this discussion before where you urge me to trust the host...
> 
> I am just implementing the protocol specification given by the host. If I cannot trust the
> specified protocol, I am not sure what else can be done here.

I'm sorry I got too upset and we're not communicating correctly.

Anyway, looking at the code, there is actually locking in
process_chn_event() which protect ->fcopy_context.  It's still sucky to
only store the last message in the queue but that's ok.

+static int fcopy_handle_handshake(int op)
+{
+       int ret = 1;
+
+       pr_info("FCP: user-mode registering done.\n");
+       fcopy_transaction.active = false;
+       set_channel_read_state((struct vmbus_channel *)
+                               fcopy_transaction.fcopy_context,
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dereferenced inside the call to set_channel_read_state()

+                               true);
+
+       if (fcopy_transaction.fcopy_context)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Checked for NULL.

+               hv_fcopy_onchannelcallback(fcopy_transaction.fcopy_context);
+
+       in_hand_shake = false;
+       return ret;
+}

regards,
dan carpenter


  reply	other threads:[~2014-01-10  9:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-08 23:48 [PATCH 1/1] Drivers: hv: Implement the file copy service K. Y. Srinivasan
2014-01-08 23:15 ` Greg KH
2014-01-09  7:39 ` Dan Carpenter
2014-01-09 11:18   ` [PATCH 2/2] Drivers: hv: balloon: Online the hot-added memory "in context" " Victor Miasnikov
2014-01-09 18:55   ` KY Srinivasan
2014-01-09 20:09     ` Dan Carpenter
2014-01-09 20:14       ` gregkh
2014-01-09 21:13         ` KY Srinivasan
2014-01-09 21:05       ` KY Srinivasan
2014-01-10  9:40         ` Dan Carpenter [this message]
2014-01-09 12:03 ` Olaf Hering
2014-01-09 18:01   ` KY Srinivasan

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=20140110094015.GU30234@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=apw@canonical.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jasowang@redhat.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olaf@aepfle.de \
    /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