Linux IOMMU Development
 help / color / mirror / Atom feed
From: Pranjal Shrivastava <praan@google.com>
To: Akhilesh Patil <akhilesh@ee.iitb.ac.in>
Cc: jgg@ziepe.ca, kevin.tian@intel.com, joro@8bytes.org,
	will@kernel.org, robin.murphy@arm.com, baolu.lu@linux.intel.com,
	nicolinc@nvidia.com, jgg@nvidia.com, iommu@lists.linux.dev,
	linux-kernel@vger.kernel.org, akhileshpatilvnit@gmail.com,
	skhan@linuxfoundation.org
Subject: Re: [PATCH] iommufd: viommu: free memory allocated by kvcalloc() using kvfree()
Date: Fri, 15 Aug 2025 10:45:26 +0000	[thread overview]
Message-ID: <aJ8PxlIP_KtYgYun@google.com> (raw)
In-Reply-To: <aJifyVV2PL6WGEs6@bhairav-test.ee.iitb.ac.in>

On Sun, Aug 10, 2025 at 07:04:01PM +0530, Akhilesh Patil wrote:
> Use kvfree() instead of kfree() to free pages allocated by kvcalloc()
> in iommufs_hw_queue_alloc_phys() to fix potential memory corruption.
> Ensure the memory is properly freed, as kvcalloc may internally use
> vmalloc or kmalloc depending on available memory in the system.
> 
> Fixes: 2238ddc2b056 ("iommufd/viommu: Add IOMMUFD_CMD_HW_QUEUE_ALLOC ioctl")
> Signed-off-by: Akhilesh Patil <akhilesh@ee.iitb.ac.in>

Reviewed-by: Pranjal Shrivastava <praan@google.com>

Thanks,
Praan

  parent reply	other threads:[~2025-08-15 10:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-10 13:34 [PATCH] iommufd: viommu: free memory allocated by kvcalloc() using kvfree() Akhilesh Patil
2025-08-10 17:53 ` Nicolin Chen
2025-08-15 10:06 ` Tian, Kevin
2025-08-15 10:45 ` Pranjal Shrivastava [this message]
2025-08-15 13:42 ` Markus Elfring
2025-08-15 14:15   ` Robin Murphy
2025-08-15 14:52     ` Markus Elfring
2025-08-18 14:14 ` Jason Gunthorpe

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=aJ8PxlIP_KtYgYun@google.com \
    --to=praan@google.com \
    --cc=akhilesh@ee.iitb.ac.in \
    --cc=akhileshpatilvnit@gmail.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@nvidia.com \
    --cc=jgg@ziepe.ca \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolinc@nvidia.com \
    --cc=robin.murphy@arm.com \
    --cc=skhan@linuxfoundation.org \
    --cc=will@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