qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] linux-user: Add support for pivot_root syscall


From: Laurent Vivier
Subject: Re: [PATCH] linux-user: Add support for pivot_root syscall
Date: Sat, 13 Feb 2021 23:59:18 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0

Le 12/10/2020 à 09:14, David Leonard a écrit :
> 
> Tested on Ubuntu 20.04 x86_64 against arm-linux-gnueabi toolchain.
> 
> Signed-off-by: David Leonard <David.Leonard@digi.com>
> ---
>  linux-user/syscall.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 897d20c076..8143c8c280 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -345,6 +345,10 @@ _syscall5(int, kcmp, pid_t, pid1, pid_t, pid2, int, type,
>            unsigned long, idx1, unsigned long, idx2)
>  #endif
> 
> +#if defined(TARGET_NR_pivot_root) && defined(__NR_pivot_root)
> +_syscall2(int, pivot_root, const char *, new_root, const char *, put_old)
> +#endif
> +
>  /*
>   * It is assumed that struct statx is architecture independent.
>   */
> @@ -8834,6 +8838,22 @@ static abi_long do_syscall1(void *cpu_env, int num, 
> abi_long arg1,
>          ret = get_errno(umount2(p, arg2));
>          unlock_user(p, arg1, 0);
>          return ret;
> +#endif
> +#if defined(TARGET_NR_pivot_root) && defined(__NR_pivot_root)
> +    case TARGET_NR_pivot_root:
> +        {
> +            void *p2;
> +            p  = lock_user_string(arg1);
> +            p2 = lock_user_string(arg2);
> +            if (!p || !p2) {
> +                ret = -TARGET_EFAULT;
> +            } else {
> +                ret = get_errno(pivot_root(p, p2));
> +            }
> +            unlock_user(p2, arg2, 0);
> +            unlock_user(p, arg1, 0);
> +        }
> +        return ret;
>  #endif
>      case TARGET_NR_ioctl:
>          return do_ioctl(arg1, arg2, arg3);

Reviewed-by: Laurent Vivier <laurent@vivier.eu>

Please, re-send you patch to qemu-devel@nongnu.org

Thanks,
Laurent



reply via email to

[Prev in Thread] Current Thread [Next in Thread]