[PATCH v3 2/4] mm: simplify compat_sys_move_pages
David Laight
David.Laight at ACULAB.COM
Tue May 18 13:49:34 PDT 2021
From: Arnd Bergmann
> Sent: 17 May 2021 21:34
>
> The compat move_pages() implementation uses compat_alloc_user_space()
> for converting the pointer array. Moving the compat handling into
> the function itself is a bit simpler and lets us avoid the
> compat_alloc_user_space() call.
>
> Signed-off-by: Arnd Bergmann <arnd at arndb.de>
> ---
> mm/migrate.c | 45 ++++++++++++++++++++++++++++++---------------
> 1 file changed, 30 insertions(+), 15 deletions(-)
>
> diff --git a/mm/migrate.c b/mm/migrate.c
> index b234c3f3acb7..a68d07f19a1a 100644
> --- a/mm/migrate.c
> +++ b/mm/migrate.c
> @@ -1855,6 +1855,23 @@ static void do_pages_stat_array(struct mm_struct *mm, unsigned long nr_pages,
> mmap_read_unlock(mm);
> }
>
> +static int put_compat_pages_array(const void __user *chunk_pages[],
> + const void __user * __user *pages,
> + unsigned long chunk_nr)
> +{
Should that be get_compat_pages_array() ?
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
More information about the linux-arm-kernel
mailing list