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

From: Tian, Kevin

Date: Tue Mar 31 2026 - 03:49:17 EST


> From: Duan, Zhenzhong <zhenzhong.duan@xxxxxxxxx>
> Sent: Monday, March 30, 2026 11:08 AM
>
> 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>

Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>