Re: [PATCH v5 2/4] uaccess: always export _copy_[from|to]_user with CONFIG_RUST

From: Alice Ryhl
Date: Tue Apr 16 2024 - 05:57:26 EST


On Tue, Apr 16, 2024 at 1:05 AM Kees Cook <keescook@xxxxxxxxxxxx> wrote:
>
> On Mon, Apr 15, 2024 at 07:13:54AM +0000, Alice Ryhl wrote:
> > From: Arnd Bergmann <arnd@xxxxxxxx>
> >
> > 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@xxxxxxxx>
>
> Thanks for the updates and the comment on testing. :)
>
> Reviewed-by: Kees Cook <keescook@xxxxxxxxxxxx>

Thanks for taking a look :)

Alice