[PATCH v4 0/4] s390/vfio-ap: Fix pre-existing bugs in vfio_ap device driver
From: Anthony Krowiak
Date: Fri Aug 28 2026 - 17:47:15 EST
The sashiko AI reported several pre-existing bugs in the vfio_ap device
driver code while reviewing unrelated patches. This series fixes four
such bugs.
Change log v3 => v4:
~~~~~~~~~~~~~~~~~~~
Patch 1/4: Fix leak of pinned NIB and registered NISC in
vfio_ap_irq_enable/disable()
* Overrode the response status in vfio_irq_disable() for the
AP_RESPONSE_NORMAL case when vfio_ap_wait_for_irqclear() returns false.
* Changed name of vfio_ap_wait_for_irqclear() to
vfio_ap_wait_for_irq_state() and added a parameter to specify
the value (0 = disabled, 1 = enabled) to which the status.irq_enabled
(I-bit) is to be compared.
* Added a call to vfio_ap_wait_for_irq_state() to vfio_ap_irq_enable()
to verify that the I-bit is set when AP_RESPONSE_NORMAL is returned
from the AQIC call before proceeding.
Patch 3/4: Fix unbounded loop in apq_reset_check()
* Check return code from apq_status_check() called from apq_reset_check().
If it returns 0 when the AP_RESET_MAX_WAIT timeout is detected, then
clean up AQIC resources.
Anthony Krowiak (4):
s390/vfio-ap: Fix leak of pinned NIB and registered NISC in
vfio_ap_irq_enable/disable()
s390/vfio-ap: Fix failure to release IRQ notification eventfd contexts
s390/vfio-ap: Fix unbounded loop in apq_reset_check()
s390/vfio-ap: Use AP_DOMAINS for adm_add bitmap size in
vfio_ap_mdev_cfg_add()
drivers/s390/crypto/vfio_ap_ops.c | 216 +++++++++++++++++++++++++-----
1 file changed, 186 insertions(+), 30 deletions(-)
--
2.53.0