[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v1 5/9] uaccess: Switch to copy_{to/from}_user_partial() when relevant
- To: "Christophe Leroy (CS GROUP)" <chleroy@xxxxxxxxxx>
- From: Alice Ryhl <aliceryhl@xxxxxxxxxx>
- Date: Mon, 27 Apr 2026 18:07:28 +0000
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date"
- Cc: Yury Norov <ynorov@xxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>, David Laight <david.laight.linux@xxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, linux-alpha@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-snps-arc@xxxxxxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, kvm@xxxxxxxxxxxxxxx, linux-riscv@xxxxxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, linux-um@xxxxxxxxxxxxxxxxxxx, dmaengine@xxxxxxxxxxxxxxx, linux-efi@xxxxxxxxxxxxxxx, linux-fsi@xxxxxxxxxxxxxxxx, amd-gfx@xxxxxxxxxxxxxxxxxxxxx, dri-devel@xxxxxxxxxxxxxxxxxxxxx, intel-gfx@xxxxxxxxxxxxxxxxxxxxx, linux-wpan@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, linux-wireless@xxxxxxxxxxxxxxx, linux-spi@xxxxxxxxxxxxxxx, linux-media@xxxxxxxxxxxxxxx, linux-staging@xxxxxxxxxxxxxxx, linux-serial@xxxxxxxxxxxxxxx, linux-usb@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, ocfs2-devel@xxxxxxxxxxxxxxx, bpf@xxxxxxxxxxxxxxx, kasan-dev@xxxxxxxxxxxxxxxx, linux-mm@xxxxxxxxx, linux-x25@xxxxxxxxxxxxxxx, rust-for-linux@xxxxxxxxxxxxxxx, linux-sound@xxxxxxxxxxxxxxx, sound-open-firmware@xxxxxxxxxxxxxxxx, linux-csky@xxxxxxxxxxxxxxx, linux-hexagon@xxxxxxxxxxxxxxx, loongarch@xxxxxxxxxxxxxxx, linux-m68k@xxxxxxxxxxxxxxxxxxxx, linux-openrisc@xxxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, linux-arch@xxxxxxxxxxxxxxx
- Delivery-date: Mon, 27 Apr 2026 18:52:47 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Mon, Apr 27, 2026 at 07:13:46PM +0200, Christophe Leroy (CS GROUP) wrote:
> diff --git a/rust/helpers/uaccess.c b/rust/helpers/uaccess.c
> index 01de4fbbcc84..710e07cd60ae 100644
> --- a/rust/helpers/uaccess.c
> +++ b/rust/helpers/uaccess.c
> @@ -5,13 +5,13 @@
> __rust_helper unsigned long
> rust_helper_copy_from_user(void *to, const void __user *from, unsigned long
> n)
> {
> - return copy_from_user(to, from, n);
> + return copy_from_user_partial(to, from, n);
> }
>
> __rust_helper unsigned long
> rust_helper_copy_to_user(void __user *to, const void *from, unsigned long n)
> {
> - return copy_to_user(to, from, n);
> + return copy_to_user_partial(to, from, n);
> }
No Rust code uses the return value for anything other than comparing it
with zero, so you can keep these as copy_[from|to]_user() without
issues.
Thanks, Alice
|