Re: [PATCH] iommufd/selftest: Rework TEST_LENGTH to test min_size explicitly

2023-10-16 Thread Jason Gunthorpe
On Sun, Oct 15, 2023 at 12:46:48AM -0700, Nicolin Chen wrote: > TEST_LENGTH passing ".size = sizeof(struct _struct) - 1" expects -EINVAL > from "if (ucmd.user_size < op->min_size)" check in iommufd_fops_ioctl(). > This has been working when min_size is exactly the size of the structure. > > Howeve

RE: [PATCH] iommufd/selftest: Rework TEST_LENGTH to test min_size explicitly

2023-10-16 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Sunday, October 15, 2023 3:47 PM > > TEST_LENGTH passing ".size = sizeof(struct _struct) - 1" expects -EINVAL > from "if (ucmd.user_size < op->min_size)" check in iommufd_fops_ioctl(). > This has been working when min_size is exactly the size of the structure. > > Ho

[PATCH] iommufd/selftest: Rework TEST_LENGTH to test min_size explicitly

2023-10-15 Thread Nicolin Chen
TEST_LENGTH passing ".size = sizeof(struct _struct) - 1" expects -EINVAL from "if (ucmd.user_size < op->min_size)" check in iommufd_fops_ioctl(). This has been working when min_size is exactly the size of the structure. However, if the size of the structure becomes larger than min_size, i.e. the p