Re: [PATCH] iommufd: Fix return value of iommufd_fault_fops_write()
From: Pranjal Shrivastava
Date: Mon Mar 30 2026 - 05:39:13 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>
Reviewed-by: Pranjal Shrivastava <praan@xxxxxxxxxx>
Thanks,
Praan