Re: [PATCH v2 1/8] s390/vfio-ap: Fix stale do_remove flag across iterations in vfio_ap_mdev_cfg_remove
From: Matthew Rosato
Date: Tue Aug 11 2026 - 10:57:53 EST
On 8/10/26 3:22 PM, Anthony Krowiak wrote:
> The do_remove flag in vfio_ap_mdev_cfg_remove() is initialised to zero
> before the loop that iterates over the list of matrix mdevs, but is
> never reset at the start of each iteration. Since do_remove is
> OR-accumulated across iterations, a positive result from one mdev
> carries over to subsequent mdevs.
>
> The fix is to set the do_remove flag with the first call to bitmap_and;
> for example: do_remove = bitmap_an rather than do_remove |= bitmap_and.
>
> Fixes: eeb386aeb5b7 ("s390/vfio-ap: handle config changed and scan complete notification")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Anthony Krowiak <akrowiak@xxxxxxxxxxxxx>
Reviewed-by: Matthew Rosato <mjrosato@xxxxxxxxxxxxx>