RE: [PATCH v8 4/5] iommufd/selftest: Add coverage for IOMMU_GET_HW_INFO ioctl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> From: Liu, Yi L <yi.l.liu@xxxxxxxxx>
> Sent: Wednesday, August 16, 2023 8:14 PM
> 
> 
> +TEST_F(iommufd_ioas, get_hw_info)
> +{
> +	struct iommu_test_hw_info buffer_exact;
> +	struct iommu_test_hw_info_buffer {
> +		struct iommu_test_hw_info info;
> +		uint64_t trailing_bytes;
> +	} buffer_larger;
> +
> +	if (self->device_id) {
> +		/* Provide a zero-size user_buffer */
> +		test_cmd_get_hw_info(self->device_id, NULL, 0);
> +		/* Provide a user_buffer with exact size */
> +		test_cmd_get_hw_info(self->device_id, &buffer_exact,
> sizeof(buffer_exact));
> +		/*
> +		 * Provide a user_buffer with size larger than the exact size to
> check if
> +		 * kernel zero the trailing bytes.
> +		 */
> +		test_cmd_get_hw_info(self->device_id, &buffer_larger,
> sizeof(buffer_larger));

Do we also want to test a case where size is smaller than the exact size?




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux