[CRIU] [PATCH 04/17] dump: get tasks ids from parasite

Pavel Emelyanov xemul at parallels.com
Fri Nov 7 05:03:43 PST 2014


> @@ -169,10 +169,8 @@ struct parasite_dump_misc {
>   * and still fit the struct in one page
>   */
>  #define PARASITE_MAX_GROUPS							\
> -	(PAGE_SIZE								\
> -	 - sizeof(unsigned int)			/* cap_last_cap */		\
> -	 - 4 * CR_CAP_SIZE * sizeof(u32)	/* cap_{inh,prm,eff,bnd} */ 	\
> -	 - 2 * sizeof(unsigned int)		/* secbits, ngroups*/		\
> +	(PAGE_SIZE -								\
> +	 offsetof(struct parasite_dump_creds, groups)				\
>  	) / sizeof(unsigned int)		/* groups */
>  
>  struct parasite_dump_creds {
> @@ -183,9 +181,11 @@ struct parasite_dump_creds {
>  	u32			cap_eff[CR_CAP_SIZE];
>  	u32			cap_bnd[CR_CAP_SIZE];
>  
> +	int			uids[4];
> +	int			gids[4];
>  	unsigned int		secbits;
>  	unsigned int		ngroups;
> -	unsigned int		groups[PARASITE_MAX_GROUPS];
> +	unsigned int		groups[0];

Why do we zero the size? The checks for parasite-size would see
sizeof this structure to be too small which is not very good.

>  };
>  



More information about the CRIU mailing list