]> www.infradead.org Git - users/dwmw2/linux.git/commit
uaccess: always export _copy_[from|to]_user with CONFIG_RUST
authorArnd Bergmann <arnd@arndb.de>
Tue, 28 May 2024 14:58:03 +0000 (14:58 +0000)
committerMiguel Ojeda <ojeda@kernel.org>
Mon, 8 Jul 2024 21:44:01 +0000 (23:44 +0200)
commit1f9a8286bc0c3df7d789ea625d9d9db3d7779f2d
tree9abdf014774dd6862a8899462cf0ca472ed59863
parent1b580e7b9ba2e5939c4b94da2cb4888605b39955
uaccess: always export _copy_[from|to]_user with CONFIG_RUST

Rust code needs to be able to access _copy_from_user and _copy_to_user
so that it can skip the check_copy_size check in cases where the length
is known at compile-time, mirroring the logic for when C code will skip
check_copy_size. To do this, we ensure that exported versions of these
methods are available when CONFIG_RUST is enabled.

Alice has verified that this patch passes the CONFIG_TEST_USER_COPY test
on x86 using the Android cuttlefish emulator.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Link: https://lore.kernel.org/r/20240528-alice-mm-v7-2-78222c31b8f4@google.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
include/linux/uaccess.h
lib/usercopy.c