All of lore.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>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"vojtech@suse.cz" <vojtech@suse.cz>,
	"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	"apw@canonical.com" <apw@canonical.com>,
	"devel@linuxdriverproject.org" <devel@linuxdriverproject.org>
Subject: Re: [PATCH 1/1] Drivers: input: serio: New driver to support Hyper-V synthetic keyboard
Date: Tue, 17 Sep 2013 01:13:37 +0300	[thread overview]
Message-ID: <20130916221337.GS25896@mwanda> (raw)
In-Reply-To: <a76e49ef4b7f44f9a99acea5295d1491@SN2PR03MB061.namprd03.prod.outlook.com>

On Mon, Sep 16, 2013 at 09:55:44PM +0000, KY Srinivasan wrote:
> 
> 
> > -----Original Message-----
> > From: Dan Carpenter [mailto:dan.carpenter@oracle.com]
> > Sent: Monday, September 16, 2013 1:13 PM
> > To: KY Srinivasan
> > Cc: olaf@aepfle.de; gregkh@linuxfoundation.org; jasowang@redhat.com; Dmitry
> > Torokhov; linux-kernel@vger.kernel.org; vojtech@suse.cz; linux-
> > input@vger.kernel.org; apw@canonical.com; devel@linuxdriverproject.org
> > Subject: Re: [PATCH 1/1] Drivers: input: serio: New driver to support Hyper-V
> > synthetic keyboard
> > 
> > On Mon, Sep 16, 2013 at 06:42:25PM +0000, KY Srinivasan wrote:
> > > Dan,
> > >
> > > Rolling the changes you have indicated is not the issue; this can trivially be
> > done.
> > > My contention is that it is not needed given that the underlying function is
> > already
> > > doing that. Look at the function  vmbus_recvpacket_raw() in
> > drivers/hv/channel.c.
> > >
> > 
> > I'm confused.
> > 
> > There is no mention of ->offset8 in vmbus_recvpacket_raw().
> 
> As you can see the vmbus_recvpacket_raw() ensures that the complete
> packet is read and if the buffer specified is not large enough nothing is 
> read. The packet header has information about the length of the packet
> and the offset where the payload is.  
> > 

No one is talking about the ->len8.  I'm saying that we should check
->offset8.

> > It's a good idea to add a check there but the lower levels don't know
> > about the sizeof(synth_kbd_protocol_response) so we would still need
> > something like my check.
> 
> Why would the lower level code need to know  anything about the layout of a
> particular message type. The lower level code is guaranteeing that a complete
> packet has been read in and that should be sufficient - assuming we trust the host.
> 

Of course, we don't need to check anything if we trust the host.  I said
that already.  Just add the check for robustness.

> We have already spent more time on this than we should; I will make the necessary
> changes.

Thank you.

regards,
dan carpenter

  reply	other threads:[~2013-09-16 22:13 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-16  5:28 [PATCH 1/1] Drivers: input: serio: New driver to support Hyper-V synthetic keyboard K. Y. Srinivasan
2013-09-16  8:21 ` Dan Carpenter
2013-09-16  8:21   ` Dan Carpenter
2013-09-16 14:46   ` KY Srinivasan
2013-09-16 14:46     ` KY Srinivasan
2013-09-16 15:05     ` Dan Carpenter
2013-09-16 16:56       ` KY Srinivasan
2013-09-16 17:09         ` Dmitry Torokhov
2013-09-16 18:29           ` KY Srinivasan
2013-09-16 18:33             ` Dan Carpenter
2013-09-16 18:42               ` KY Srinivasan
2013-09-16 18:42                 ` KY Srinivasan
2013-09-16 20:13                 ` Dan Carpenter
2013-09-16 21:55                   ` KY Srinivasan
2013-09-16 22:13                     ` Dan Carpenter [this message]
2013-09-16 22:16             ` Dmitry Torokhov
2013-09-16 15:20 ` Dmitry Torokhov
2013-09-16 15:20   ` Dmitry Torokhov
2013-09-16 15:52   ` KY Srinivasan
2013-09-16 17:13     ` Dmitry Torokhov
2013-09-16 17:13       ` Dmitry Torokhov

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=20130916221337.GS25896@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=apw@canonical.com \
    --cc=devel@linuxdriverproject.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jasowang@redhat.com \
    --cc=kys@microsoft.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olaf@aepfle.de \
    --cc=vojtech@suse.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.