]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/uapi: Use named union for user data
authorJacob Pan <jacob.pan.linux@gmail.com>
Fri, 25 Sep 2020 16:32:44 +0000 (09:32 -0700)
committerJoerg Roedel <jroedel@suse.de>
Thu, 1 Oct 2020 12:52:46 +0000 (14:52 +0200)
commit315545f1596741ba68f82320c229008e9c343f4a
tree0128ef643c3e803b601e0665b73b2a818b717c53
parentdfb48410a8d68ca68ef196d3059382fd64e8ace4
iommu/uapi: Use named union for user data

IOMMU UAPI data size is filled by the user space which must be validated
by the kernel. To ensure backward compatibility, user data can only be
extended by either re-purpose padding bytes or extend the variable sized
union at the end. No size change is allowed before the union. Therefore,
the minimum size is the offset of the union.

To use offsetof() on the union, we must make it named.

Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Link: https://lore.kernel.org/linux-iommu/20200611145518.0c2817d6@x1.home/
Link: https://lore.kernel.org/r/1601051567-54787-4-git-send-email-jacob.jun.pan@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel/iommu.c
drivers/iommu/intel/svm.c
include/uapi/linux/iommu.h