Re: [PATCH] iommufd: Fix return value of iommufd_fault_fops_write()

From: Jason Gunthorpe

Date: Tue Mar 31 2026 - 12:29:11 EST


On Sun, Mar 29, 2026 at 11:07:55PM -0400, Zhenzhong Duan wrote:
> copy_from_user() may return number of bytes failed to copy, we should
> not pass over this number to user space to cheat that write() succeed.
> Instead, -EFAULT should be returned.
>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: 07838f7fd529 ("iommufd: Add iommufd fault object")
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@xxxxxxxxx>
> Reviewed-by: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>
> ---
> drivers/iommu/iommufd/eventq.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)

Applied to for-next, thanks

Jason