Re: [PATCH rc v2] iommufd: Explicitize struct iommu_hwpt_pgfault padding
From: Jason Gunthorpe
Date: Mon Jan 20 2025 - 11:45:12 EST
On Sun, Jan 19, 2025 at 10:24:11PM -0800, Nicolin Chen wrote:
> Though the padding could be done by the compiler, add a 32-bit padding
> explicitly. Update iommufd_compose_fault_message to set it explicitly.
> Also, change the __u64 addr to __aligned_u64.
Mention that this also leaks the content of kernel stack memory to
userspace since it was never zeroing the padding.
> Fixes: c714f15860fc ("iommufd: Add fault and response message definitions")
> Signed-off-by: Nicolin Chen <nicolinc@xxxxxxxxxx>
> ---
> drivers/iommu/iommufd/fault.c | 1 +
> include/uapi/linux/iommufd.h | 4 +++-
> 2 files changed, 4 insertions(+), 1 deletion(-)
Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
Jason