[PATCH 2/3]: An implementation of HyperV KVP functionality

Hank Janssen hjanssen at microsoft.com
Wed Dec 8 18:09:14 UTC 2010


> From: Ky Srinivasan [mailto:ksrinivasan at novell.com]
> Sent: Tuesday, December 07, 2010 3:19 PM
> >>> On 12/7/2010 at  5:29 PM, in message
> <20101207222933.GA10431 at ioremap.net>,
> Evgeniy Polyakov <zbr at ioremap.net> wrote:
> > On Tue, Dec 07, 2010 at 03:25:56PM -0700, Ky Srinivasan
> > (ksrinivasan at novell.com) wrote:
> >> +static void shutdown_onchannelcallback(void *context)
> >> +{
> >> +	struct vmbus_channel *channel = context;
> >> +	u8 *buf;
> >> +	u32 buflen, recvlen;
> >> +	u64 requestid;
> >> +	u8  execute_shutdown = false;
> >> +
> >> +	struct shutdown_msg_data *shutdown_msg;
> >> +
> >> +	struct icmsg_hdr *icmsghdrp;
> >> +	struct icmsg_negotiate *negop = NULL;
> >> +
> >> +	buflen = PAGE_SIZE;
> >> +	buf = kmalloc(buflen, GFP_ATOMIC);
> >> +
> >> +	vmbus_recvpacket(channel, buf, buflen, &recvlen, &requestid);
> >
> > This did not change since previous review and this is wrong.
> > It is the right way to crash kernel.
> >
> > I did not read further since this is a show-stopper imo.
> Hank, do you want to respond to this comment.
> 

I will submit a patch for hv_utils.c to check the return value from
kmalloc and vmbus_recvpacket and return if either one of them fail.

The function is a void because they are treated here as fire and
Forget. But it comment about what would happen if kmalloc or 
Vmbus_recvpacket fails is correct. We could cause a crash.

So I will correct that part.

Hank.





More information about the devel mailing list