lkml.org 
[lkml]   [2013]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRE: [RFCv2 11/11] remoteproc: Support virtio config space.
Hi Ido,

> > +void rproc_virtio_get(struct virtio_device *vdev, unsigned offset,
> > + void *buf, unsigned
> len)
> > +{
> > + struct rproc_vdev *rvdev = vdev_to_rvdev(vdev);
> > + void *cfg = &rvdev->rsc->vring[rvdev->rsc->num_of_vrings];
> > + memcpy(buf, cfg + offset, len);
> > +}
> > +
> > +void rproc_virtio_set(struct virtio_device *vdev, unsigned offset,
> > + const void *buf, unsigned len)
> > +{
> > + struct rproc_vdev *rvdev = vdev_to_rvdev(vdev);
> > + void *cfg = &rvdev->rsc->vring[rvdev->rsc->num_of_vrings];
> > + memcpy(cfg + offset, buf, len);
> > }
>
> Perhaps verify the offset and length to avoid overwriting memory?

OK, I'll add checks on size of the config space.

Regards,
Sjur


\
 
 \ /
  Last update: 2013-01-15 17:01    [W:0.048 / U:5.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site