Jacob Pan d90573812e iommu/uapi: Handle data and argsz filled by users
IOMMU user APIs are responsible for processing user data. This patch
changes the interface such that user pointers can be passed into IOMMU
code directly. Separate kernel APIs without user pointers are introduced
for in-kernel users of the UAPI functionality.

IOMMU UAPI data has a user filled argsz field which indicates the data
length of the structure. User data is not trusted, argsz must be
validated based on the current kernel data size, mandatory data size,
and feature flags.

User data may also be extended, resulting in possible argsz increase.
Backward compatibility is ensured based on size and flags (or
the functional equivalent fields) checking.

This patch adds sanity checks in the IOMMU layer. In addition to argsz,
reserved/unused fields in padding, flags, and version are also checked.
Details are documented in Documentation/userspace-api/iommu.rst

Signed-off-by: Liu Yi L <yi.l.liu@intel.com>
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Reviewed-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Link: https://lore.kernel.org/r/1601051567-54787-6-git-send-email-jacob.jun.pan@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
2020-10-01 14:52:46 +02:00
..
2020-08-28 21:17:56 +02:00
2020-08-02 18:26:51 +03:00
2020-08-28 16:38:29 -07:00
2020-08-15 08:18:22 -07:00
2020-07-27 11:49:37 +02:00
2020-08-28 09:46:48 -07:00
2020-08-26 10:44:15 -07:00
2020-08-29 12:37:00 -07:00
2020-08-05 19:24:27 -07:00
2020-08-28 16:38:29 -07:00
2020-08-28 10:15:33 -07:00
2020-08-26 10:50:50 -07:00
2020-08-24 11:53:15 -07:00
2020-08-14 16:00:09 -07:00
2020-08-26 10:58:20 -07:00
2020-08-30 10:51:03 -07:00
2020-08-30 10:56:12 -07:00
2020-08-29 12:44:30 -07:00