Re: [PATCH] fsi: i2cr-scom: Return -EFAULT on usercopy failures

From: Karl Mehltretter

Date: Thu Oct 15 2026 - 01:54:20 EST


On Mon, Sep 14, 2026 at 08:24:26AM +0100, Karl Mehltretter wrote:
> copy_to_user() and copy_from_user() return the number of bytes that were
> not copied. i2cr_scom_read() and i2cr_scom_write() return that value
> directly, so a usercopy fault is reported as a successful short I/O.
>
> Return -EFAULT when either copy fails.
>
> A temporary KUnit test called i2cr_scom_write() with an invalid user
> pointer. The unmodified kernel returned 8. With this change it returned
> -EFAULT. Both versions were booted under QEMU.
>
> Fixes: c0b34bed0bbf ("fsi: Add I2C Responder SCOM driver")
> Assisted-by: LLM
> Signed-off-by: Karl Mehltretter <kmehltretter@xxxxxxxxx>

A friendly ping on this usercopy error-handling fix.

Thanks,
Karl