[CRIU] [PATCH 1/3]v3 libcriu: criu_dump_me() and library header

Pavel Emelyanov xemul at parallels.com
Thu Aug 29 15:21:21 EDT 2013


On 08/29/2013 11:08 PM, Ruslan Kuprieiev wrote:
> Hi!
> 
> Patch 1\3 contains criu_dump_me() for library and library header.
>         -- criu_dump_me() gets an argument of  type struct criu_dump_args
> from user program,
>           processes it and sends request to criu through unix domain 
> socket.
>           Then, it gets flag from criu and returns it back to program.
>         -- libcriu.h contains definitions of flags, struct 
> criu_dump_args etc.
>            So, it is to be used in user program.
> 
> Signed-off-by: Ruslan Kuprieiev <kupruser at gmail.com>
> 


> +int criu_dump_me(struct criu_dump_args *arg)
> +{
> +	int socket_fd;
> +	int ret, c;
> +	struct sockaddr_un server_addr;
> +	socklen_t server_addr_len;

I'm trying to imagine how this all should work when a user that has some
3rd party app linked with v0.7's libcriu.so upgrades criu and has v0.8's
one with criu_dump_args extended.

In his software the new "tail" of this structure is not seen (as hi had it
compiled against old headers with shorted struct). Thus we'd see uninitialized
data here in the library and have no idea how to check this.

I think we need the criu_alloc_args() call that will call malloc() with
proper size and zeroify the whole structure.



More information about the CRIU mailing list