lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220913160708.50466335.pasic@linux.ibm.com>
Date:   Tue, 13 Sep 2022 16:07:08 +0200
From:   Halil Pasic <pasic@...ux.ibm.com>
To:     Tony Krowiak <akrowiak@...ux.ibm.com>
Cc:     linux-s390@...r.kernel.org, linux-kernel@...r.kernel.org,
        kvm@...r.kernel.org, jjherne@...ux.ibm.com, borntraeger@...ibm.com,
        cohuck@...hat.com, mjrosato@...ux.ibm.com,
        alex.williamson@...hat.com, stable@...r.kernel.org,
        Halil Pasic <pasic@...ux.ibm.com>
Subject: Re: [PATCH v3 2/2] s390/vfio-ap: fix unlinking of queues from the
 mdev

On Tue, 23 Aug 2022 11:06:43 -0400
Tony Krowiak <akrowiak@...ux.ibm.com> wrote:

> The vfio_ap_mdev_unlink_adapter and vfio_ap_mdev_unlink_domain functions
> add the associated vfio_ap_queue objects to the hashtable that links them
> to the matrix mdev to which their APQN is assigned. In order to unlink
> them, they must be deleted from the hashtable; if not, they will continue
> to be reset whenever userspace closes the mdev fd or removes the mdev.
> This patch fixes that issue.

I'm not so sure about that!

> 
> Cc: stable@...r.kernel.org
> Fixes: 70aeefe574cb ("s390/vfio-ap: reset queues after adapter/domain unassignment")
> Reported-by: Tony Krowiak <akrowiak@...ux.ibm.com>
> Signed-off-by: Tony Krowiak <akrowiak@...ux.ibm.com>
> ---
>  drivers/s390/crypto/vfio_ap_ops.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/s390/crypto/vfio_ap_ops.c b/drivers/s390/crypto/vfio_ap_ops.c
> index ee82207b4e60..2493926b5dfb 100644
> --- a/drivers/s390/crypto/vfio_ap_ops.c
> +++ b/drivers/s390/crypto/vfio_ap_ops.c
> @@ -1049,8 +1049,7 @@ static void vfio_ap_mdev_unlink_adapter(struct ap_matrix_mdev *matrix_mdev,
>  		if (q && qtable) {
>  			if (test_bit_inv(apid, matrix_mdev->shadow_apcb.apm) &&
>  			    test_bit_inv(apqi, matrix_mdev->shadow_apcb.aqm))
> -				hash_add(qtable->queues, &q->mdev_qnode,
> -					 q->apqn);

Careful qtable->queues is not supposed to be the same as
matrix_mdev->qtable.queues it is rather a function local
qtable that you use to know which queues were unlinked and
need resetting.

Have a look at vfio_ap_mdev_hot_unplug_adapter()

> +				vfio_ap_unlink_queue_fr_mdev(q);

IMHO this change is completely bogous. BTW
vfio_ap_unlink_apqn_fr_mdev() a couple of lines above in the source
(not seen in diff context) calls vfio_ap_unlink_queue_fr_mdev().

>  		}
>  	}
>  }
> @@ -1236,8 +1235,7 @@ static void vfio_ap_mdev_unlink_domain(struct ap_matrix_mdev *matrix_mdev,
>  		if (q && qtable) {
>  			if (test_bit_inv(apid, matrix_mdev->shadow_apcb.apm) &&
>  			    test_bit_inv(apqi, matrix_mdev->shadow_apcb.aqm))
> -				hash_add(qtable->queues, &q->mdev_qnode,
> -					 q->apqn);
> +				vfio_ap_unlink_queue_fr_mdev(q);

Same as above...

Regards,
Halil

>  		}
>  	}
>  }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ