1
0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2026-01-18 04:20:44 +00:00
Philipp Stanner 313ebe47d7 string.h: add array-wrappers for (v)memdup_user()
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.

Suggested-by: David Airlie <airlied@redhat.com>
Signed-off-by: Philipp Stanner <pstanner@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Zack Rusin <zackr@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230920123612.16914-3-pstanner@redhat.com
2023-10-09 16:59:42 +10:00
..
2023-09-01 09:53:54 -07:00
2023-09-04 13:47:59 -07:00
2023-08-28 16:37:38 +02:00
2023-09-07 16:07:35 -07:00
2023-09-03 10:20:57 -07:00
2023-09-11 15:24:16 -07:00
2023-09-19 16:41:26 -07:00
2023-09-02 11:10:50 -07:00
2023-09-01 15:58:21 -07:00
2023-08-28 15:04:43 -07:00
2023-09-01 09:43:18 -07:00
2023-08-30 13:34:34 -07:00
2023-09-01 00:29:34 +02:00
2023-08-28 11:04:18 -07:00
2023-09-04 11:26:29 -07:00
2023-09-13 10:48:48 +02:00
2023-08-29 20:21:42 -07:00
2023-09-01 16:54:25 -07:00
2023-08-30 09:07:09 -07:00
2023-08-30 13:45:05 -07:00
2023-08-31 12:20:12 -07:00
2023-08-30 20:23:07 -07:00
2023-09-29 17:20:46 -07:00
2023-09-02 15:17:33 -07:00
2023-08-30 09:07:09 -07:00
2023-08-31 12:20:12 -07:00