From: Nicolin Chen <nicolinc@nvidia.com>
To: Pranjal Shrivastava <praan@google.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>,
Kevin Tian <kevin.tian@intel.com>,
"Will Deacon" <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
Joerg Roedel <joro@8bytes.org>, Peter Shier <pshier@google.com>,
<iommu@lists.linux.dev>
Subject: Re: [PATCH v2] iommu: Honor iommufd uapi for zero entry_num args
Date: Fri, 13 Nov 2026 09:54:45 -0800 [thread overview]
Message-ID: <avdO5cBwc/2ysstZ@nvidia.com> (raw)
In-Reply-To: <20261112151039.2083705-1-praan@google.com>
On Thu, Nov 12, 2026 at 03:10:39PM +0000, Pranjal Shrivastava wrote:
> @@ -556,7 +556,8 @@ static inline int __iommu_copy_struct_from_user_array(
> * @data_type: The data type of the @kdst. Must match with @user_array->type
> *
> * Copy the entire user array. kdst must have room for kdst_entry_size *
> - * user_array->entry_num bytes. Return 0 for success, otherwise -error.
> + * user_array->entry_num bytes. An empty array copies nothing, though its
> + * @data_type is still validated. Return 0 for success, otherwise -error.
> */
> static inline int
> iommu_copy_struct_from_full_user_array(void *kdst, size_t kdst_entry_size,
> @@ -569,7 +570,7 @@ iommu_copy_struct_from_full_user_array(void *kdst, size_t kdst_entry_size,
> if (user_array->type != data_type)
> return -EINVAL;
> if (!user_array->entry_num)
> - return -EINVAL;
> + return 0;
TBH, this doesn't seem very necessary..
Though I don't have a problem so long as Jason is okay with it..
Yet, this alone would make things inconsistent:
* The other caller in iommufd selftest isn't updated.
* __iommu_copy_struct_from_user_array still rejects !entry_num,
and its callers (intel and selftest) aren't updated either.
Also, please don't omit "linux-kernel@vger.kernel.org" when sending
a patch, as linux-iommu doesn't trigger Sashiko scan.
Nicolin
prev parent reply other threads:[~2026-11-13 22:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 15:10 [PATCH v2] iommu: Honor iommufd uapi for zero entry_num args Pranjal Shrivastava
2026-11-13 17:54 ` Nicolin Chen [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=avdO5cBwc/2ysstZ@nvidia.com \
--to=nicolinc@nvidia.com \
--cc=iommu@lists.linux.dev \
--cc=jgg@nvidia.com \
--cc=joro@8bytes.org \
--cc=kevin.tian@intel.com \
--cc=praan@google.com \
--cc=pshier@google.com \
--cc=robin.murphy@arm.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.