[PATCH 04/13] vfio/mdev: simplify mdev_type handling

Jason Gunthorpe jgg at nvidia.com
Wed Jun 29 12:17:09 UTC 2022


On Tue, Jun 28, 2022 at 03:59:15PM -0600, Alex Williamson wrote:
> > +	strcpy(matrix_dev->mdev_type.sysfs_name, VFIO_AP_MDEV_TYPE_HWVIRT);
> 
> And then this might as well be an snprintf() as well too.

Kees has setup FORTIFY so the above will actually throw a compile
warning in build bots if the array size is too small. Changing it to
snprintf would loose this and cause undetected string truncation.

Jason


More information about the intel-gvt-dev mailing list