Re: [PATCH v2 1/5] string.h: add array-wrappers for (v)memdup_user()

From: Andy Shevchenko
Date: Sun Sep 10 2023 - 03:44:35 EST


On Fri, Sep 8, 2023 at 11:02 PM Philipp Stanner <pstanner@xxxxxxxxxx> wrote:
>
> Currently, user array duplications are sometimes done without an
> overflow check. Sometimes the checks are done manually; sometimes the
> array size is calculated with array_size() and sometimes by calculating
> n * size directly in code.
>
> Introduce wrappers for arrays for memdup_user() and vmemdup_user() to
> provide a standardized and safe way for duplicating user arrays.
>
> This is both for new code as well as replacing usage of (v)memdup_user()
> in existing code that uses, e.g., n * size to calculate array sizes.

No objections,
Reviewed-by: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>

--
With Best Regards,
Andy Shevchenko