Re: [PATCH 5/5] c/r: Add AF_UNIX support (v7)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Dan Smith (danms@xxxxxxxxxx):
> SH> why only free iov_base if ret!=0?
> 
> Because I was diagnosing a crash that only seemed to happen when I
> free()'d the buffer after it was used by sendmsg() and I forgot to
> remove this :(
> 
> >> +	a->sk_peercred.pid = task_tgid_vnr(current);
> >> +	a->sk_peercred.uid = ctx->realcred->uid;
> 
> SH> I don't know how much it matters, but of course root could be
> SH> restarting a set of tasks owned by several non-root uids, and the
> SH> peercred.uid's might need to be something other than
> ctx-> realcred->uid.  Or not?
> 
> Oh, so you're suggesting I use ctx->ecred instead?  I didn't actually
> notice the double declaration in the ckpt_ctx, but I guess that would
> be better.

No, I'm suggesting that the checkpointed application might have had
tasks owned by uids 0, 3, 55, and 1001, and a.peercred.uid might have
been 1001, right?  current, ctx->realcred->uid, and ctx->ecred might
all be different uids.  I think you just need to checkpoint the uid
(eventually an objref to a checkpointed user struct so we can also
catch the user namespace).

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

[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux