[CRIU] Re: [PATCH 07/14] parasite: Add parasite_dump_tty helper

Pavel Emelyanov xemul at parallels.com
Mon Oct 15 12:01:29 EDT 2012


On 10/15/2012 06:54 PM, Cyrill Gorcunov wrote:
> 
> Will need it to fetch tty link parameters. This is
> because the kernel provides SID/PGID related to the
> caller context, and if we're dumping the process inside
> namespace -- we need local SID/PGIDs, not global ones.
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  include/parasite-syscall.h |    3 +++
>  include/parasite.h         |    9 +++++++++
>  parasite-syscall.c         |   14 ++++++++++++++
>  parasite.c                 |   39 +++++++++++++++++++++++++++++++++++++++
>  4 files changed, 65 insertions(+), 0 deletions(-)
> 


> +int parasite_dump_tty(struct parasite_ctl *ctl, struct parasite_dump_tty *tty)
> +{
> +	struct parasite_dump_tty *p;
> +
> +	p = parasite_args(ctl, sizeof(*p));
> +	*p = *tty;

I explicitly said with the respective patch, that memcpy() of full args in both
directions is BAD.

> +
> +	if (parasite_execute(PARASITE_CMD_DUMP_TTY, ctl) < 0)
> +		return -1;
> +
> +	*tty = *p;
> +	return 0;
> +}
> +



More information about the CRIU mailing list