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

Andy Shevchenko andy.shevchenko at gmail.com
Sun Sep 10 00:43:42 PDT 2023


On Fri, Sep 8, 2023 at 11:02 PM Philipp Stanner <pstanner at redhat.com> 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 at gmail.com>

-- 
With Best Regards,
Andy Shevchenko



More information about the kexec mailing list