lkml.org 
[lkml]   [2020]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/7] Drivers: hv: vmbus: Avoid double fetch of msgtype in vmbus_on_msg_dpc()
On Wed, Dec 02, 2020 at 02:37:16PM +0100, Andrea Parri wrote:
> > > @@ -1072,12 +1073,19 @@ void vmbus_on_msg_dpc(unsigned long data)
> > > /* no msg */
> > > return;
> > >
> > > + /*
> > > + * The hv_message object is in memory shared with the host. The host
> > > + * could erroneously or maliciously modify such object. Make sure to
> > > + * validate its fields and avoid double fetches whenever feasible.
> > > + */
> > > +
> > > hdr = (struct vmbus_channel_message_header *)msg->u.payload;
> > > + msgtype = hdr->msgtype;
> >
> > Should READ_ONCE be used here?
>
> I think it should. Thank you for pointing this out.

Glad I can help.

The same comment applies to other patches as well, of course.

Wei.

>
> Andrea

\
 
 \ /
  Last update: 2020-12-02 14:42    [W:0.054 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site