summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorNicolin Chen <nicolinc@nvidia.com>2023-10-15 10:46:48 +0300
committerJason Gunthorpe <jgg@nvidia.com>2023-10-16 17:05:51 +0300
commit266dcae34d8f44c3bbab00e227f8b14517682bb7 (patch)
treec33b5681650efe7cbfd37def5b79aeaebb26132a /net
parentc97d1b20d3835178bcd0e3a86c20ce4e36b6d80c (diff)
downloadlinux-266dcae34d8f44c3bbab00e227f8b14517682bb7.tar.xz
iommufd/selftest: Rework TEST_LENGTH to test min_size explicitly
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 passing size above is larger than min_size, that min_size sanity no longer works. Since the first test in TEST_LENGTH() was to test that min_size sanity routine, rework it to support a min_size calculation, rather than using the full size of the structure. Link: https://lore.kernel.org/r/20231015074648.24185-1-nicolinc@nvidia.com Signed-off-by: Nicolin Chen <nicolinc@nvidia.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'net')
0 files changed, 0 insertions, 0 deletions