RE: [PATCH v2 vfio 1/2] vfio/pds: Always clear the save/restore FDs on reset

From: Tian, Kevin
Date: Tue Feb 27 2024 - 23:55:44 EST


> From: Brett Creeley <brett.creeley@xxxxxxx>
> Sent: Wednesday, February 28, 2024 8:32 AM
>
> After reset the VFIO device state will always be put in
> VFIO_DEVICE_STATE_RUNNING, but the save/restore files will only be
> cleared if the previous state was VFIO_DEVICE_STATE_ERROR. This
> can/will cause the restore/save files to be leaked if/when the
> migration state machine transitions through the states that
> re-allocates these files. Fix this by always clearing the
> restore/save files for resets.
>
> Fixes: 7dabb1bcd177 ("vfio/pds: Add support for firmware recovery")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Brett Creeley <brett.creeley@xxxxxxx>
> Reviewed-by: Shannon Nelson <shannon.nelson@xxxxxxx>

Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>