Files
linux-stable-mirror/include/linux
Philipp Stanner 24b17d530c string.h: add array-wrappers for (v)memdup_user()
[ Upstream commit 313ebe47d7 ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-28 16:56:16 +00:00
..
2023-07-23 13:46:54 +02:00
2023-11-08 17:26:42 +01:00
2023-08-11 15:13:51 +02:00
2022-08-17 14:23:11 +02:00
2022-10-26 12:35:12 +02:00
2022-08-31 17:16:34 +02:00
2023-10-10 21:59:06 +02:00
2023-03-30 12:47:50 +02:00
2023-08-30 16:18:19 +02:00
2022-10-26 12:35:26 +02:00
2022-08-17 14:24:08 +02:00
2023-08-03 10:22:30 +02:00
2023-11-20 11:08:16 +01:00
2023-06-21 15:59:15 +02:00
2023-08-26 14:23:39 +02:00
2023-08-03 10:22:26 +02:00
2023-10-19 23:05:33 +02:00
2023-10-19 23:05:33 +02:00
2022-07-29 17:25:32 +02:00
2022-09-15 11:30:05 +02:00