[Devel] Re: [PATCH 4/6] cr: checkpoint and restore task credentials

Oren Laadan orenl at cs.columbia.edu
Thu May 21 07:13:45 PDT 2009



Serge E. Hallyn wrote:
> Quoting Oren Laadan (orenl at cs.columbia.edu):
>>>  /* read the task_struct into the current task */
>>> -static int restore_task_struct(struct ckpt_ctx *ctx)
>>> +static int restore_task_struct(struct ckpt_ctx *ctx, struct cred **realcredp,
>>> +				struct cred **ecredp)
>> 				^^^^^^^^^^^^^^^^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^
>> 				
>> This probably belongs to restore_task_shared() ?
> 
> Why?  The task->cred and task->ecred are task properties, so
> their reference should be stored in the ckpt_hdr_task->cred_ref
> and ckpt_hdr_task->ecred_ref, no?
> 

Because they are shared objects; task->mm is also a task property...

checkpoint,restore}_task_struct() handles c/r of task properties
that are "private" to the task.

{checkpoint,restore}_task_shared() handles c/r of task properties
that are shared.

This division makes it easier to see the dependencies between
shared resources (and themselves, or others), by explicitly
reordering if necessary. For example, ns precedes mm because
sysvipc shm depends on that of ns.

In this case, for similar reasons, I'd place the user ns right
there before the rest of the ns, because sysvipc of ns depends
on credentials from user-ns.

Oren.


_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list