RE: [PATCH 1/1] Drivers: input: serio: New driver to support Hyper-V synthetic keyboard
From: KY Srinivasan <kys@microsoft.com>
Date: 2013-09-16 21:55:50
Also in:
lkml
-----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:quoted
Dan, Rolling the changes you have indicated is not the issue; this can trivially bedone.quoted
My contention is that it is not needed given that the underlying function isalreadyquoted
doing that. Look at the function vmbus_recvpacket_raw() indrivers/hv/channel.c.quoted
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.
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. We have already spent more time on this than we should; I will make the necessary changes. Regards, K. Y
regards, dan carpenter