[CRIU] [PATCH 08/12] parasite: Initialize tid_state_s::id on parasite bootstrap

Cyrill Gorcunov gorcunov at openvz.org
Fri Mar 1 14:51:59 EST 2013


On Fri, Mar 01, 2013 at 11:46:44PM +0400, Pavel Emelyanov wrote:
> On 03/01/2013 11:36 PM, Cyrill Gorcunov wrote:
> > On Fri, Mar 01, 2013 at 10:53:04PM +0400, Pavel Emelyanov wrote:
> >> On 02/28/2013 07:35 PM, Cyrill Gorcunov wrote:
> >>>
> >>> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> >>> ---
> >>>  include/parasite.h | 1 +
> >>>  parasite-syscall.c | 6 ++++++
> >>>  pie/parasite.c     | 7 ++++---
> >>>  3 files changed, 11 insertions(+), 3 deletions(-)
> >>>
> >>
> >>
> >>> int parasite_init_threads_seized(struct parasite_ctl *ctl, struct pstree_item *item)
> >>>  {
> >>> +	struct parasite_init_args *args;
> >>>  	int ret = 0, i;
> >>>  
> >>> +	args = parasite_args(ctl, struct parasite_init_args);
> >>> +	memzero(args, sizeof(*args));
> >>
> >> What for? (a hint -- "not to shit pants by chance" is bad answer).
> > 
> > Because daemon use only one field from this structure (I wanted to
> > not bloat code and used already defined structure here) still passing
> > structure with data from a previous request is a bad habbit, even if you
> > don't use them inside daemon code I think.
> 
> Why don't you zeroify all the other data exchange between crtools and
> parasite? We use it is lots of places.

For all other cases we use _all_ the members from structures we access,
so there is no need for zeroifying it (still knowing how small structures
are I would rather zeroify them in parasite_args macro, but I know you
won't buy it).


More information about the CRIU mailing list