public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@linux.ibm.com>
To: "Jason J. Herne" <jjherne@linux.ibm.com>,
	linux-s390@vger.kernel.org, Vasily Gorbik <gor@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	Heiko Carstens <hca@linux.ibm.com>
Cc: linux-kernel@vger.kernel.org,
	Alex Williamson <alex.williamson@redhat.com>,
	Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH] s390/vfio-ap: Fix memory allocation for mdev_types array
Date: Mon, 24 Oct 2022 14:01:31 +0200	[thread overview]
Message-ID: <ec945db4-328d-f721-8d6f-3e10cce72787@linux.ibm.com> (raw)
In-Reply-To: <20221021145905.15100-1-jjherne@linux.ibm.com>



Am 21.10.22 um 16:59 schrieb Jason J. Herne:
> The vfio-ap crypto driver fails to allocate memory for an array of
> pointers used to pass supported mdev types to mdev_register_parent().
> 
> Since we only support a single mdev type, the fix is to allocate a
> single entry in the ap_matrix_dev->mdev_types array.
> 
> Fixes: 63e685747784 ("s390: vfio-ap: base implementation of VFIO AP device driver")
> Cc: stable@vger.kernel.org
> Cc: Tony Krowiak <akrowiak@linux.ibm.com>
> Reported-by: Christian Borntraeger <borntraeger@linux.ibm.com>
> Signed-off-by: Jason J. Herne <jjherne@linux.ibm.com>
> ---
>   drivers/s390/crypto/vfio_ap_private.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/s390/crypto/vfio_ap_private.h b/drivers/s390/crypto/vfio_ap_private.h
> index 2eddd5f34ed3..976a65f32e7d 100644
> --- a/drivers/s390/crypto/vfio_ap_private.h
> +++ b/drivers/s390/crypto/vfio_ap_private.h
> @@ -52,7 +52,7 @@ struct ap_matrix_dev {
>   	struct mutex guests_lock; /* serializes access to each KVM guest */
>   	struct mdev_parent parent;
>   	struct mdev_type mdev_type;
> -	struct mdev_type *mdev_types[];
> +	struct mdev_type *mdev_types[1];
>   };
>   
>   extern struct ap_matrix_dev *matrix_dev;


Thanks, will go via s390-fixes.

Alex, FYI.

      parent reply	other threads:[~2022-10-24 13:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-21 14:59 [PATCH] s390/vfio-ap: Fix memory allocation for mdev_types array Jason J. Herne
2022-10-21 16:46 ` Matthew Rosato
2022-10-24 12:01 ` Christian Borntraeger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ec945db4-328d-f721-8d6f-3e10cce72787@linux.ibm.com \
    --to=borntraeger@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=alex.williamson@redhat.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=hch@infradead.org \
    --cc=jjherne@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox