[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <DS7PR12MB8322000C7A4F92872BE035BDE8989@DS7PR12MB8322.namprd12.prod.outlook.com>
Date: Thu, 13 Apr 2023 13:05:35 +0000
From: "Gupta, Nipun" <Nipun.Gupta@....com>
To: Jason Gunthorpe <jgg@...pe.ca>
CC: "alex.williamson@...hat.com" <alex.williamson@...hat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"git (AMD-Xilinx)" <git@....com>,
"Anand, Harpreet" <harpreet.anand@....com>,
"Simek, Michal" <michal.simek@....com>,
"Agarwal, Nikhil" <nikhil.agarwal@....com>,
"Jansen Van Vuuren, Pieter" <pieter.jansen-van-vuuren@....com>,
"okaya@...nel.org" <okaya@...nel.org>
Subject: RE: [PATCH] vfio/cdx: add support for CDX bus
> -----Original Message-----
> From: Gupta, Nipun
> Sent: Friday, April 7, 2023 10:35 AM
> To: Jason Gunthorpe <jgg@...pe.ca>
> Cc: alex.williamson@...hat.com; linux-kernel@...r.kernel.org;
> kvm@...r.kernel.org; git (AMD-Xilinx) <git@....com>; Anand, Harpreet
> <harpreet.anand@....com>; Simek, Michal <michal.simek@....com>;
> Agarwal, Nikhil <nikhil.agarwal@....com>; Jansen Van Vuuren, Pieter
> <pieter.jansen-van-vuuren@....com>; okaya@...nel.org
> Subject: Re: [PATCH] vfio/cdx: add support for CDX bus
>
<snip>
>
> >
> >> +static void vfio_cdx_close_device(struct vfio_device *core_vdev)
> >> +{
> >> + struct vfio_cdx_device *vdev =
> >> + container_of(core_vdev, struct vfio_cdx_device, vdev);
> >> + int ret;
> >> +
> >> + vfio_cdx_regions_cleanup(vdev);
> >> +
> >> + /* reset the device before cleaning up the interrupts */
> >> + ret = vfio_cdx_reset_device(vdev);
> >> + if (WARN_ON(ret))
> >> + dev_warn(core_vdev->dev,
> >> + "VFIO_CDX: reset device has failed (%d)\n", ret);
> >
> > This is pretty problematic.. if the reset can fail the device is
> > returned to the system in an unknown state and it seems pretty likely
> > that it can be a way to attack the kernel.
>
> We will update the code to disable the device in case of failures.
We double checked with firmware/hardware team, when driver sends CDX
device reset command to firmware, it actually quiesce and then reset the device.
So, the device remains disabled in case of failures.
Regards,
Nipun
Powered by blists - more mailing lists