Re: [PATCH 13/14] userns: On ia64 deal with current_uid and current_gid being kuid and kgid

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

 



Zhao Hongjiang <zhaohongjiang37@xxxxxxxxx> writes:

> On 2012-9-21 8:28, Eric W. Biederman wrote:
>> From: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx>
>> 
>> These ia64 uses of current_uid and current_gid slipped through the
>> cracks when I was converting everything to kuids and kgids convert
>> them now.
>> 
>> Cc: Tony Luck <tony.luck@xxxxxxxxx>
>> Cc: Fenghua Yu <fenghua.yu@xxxxxxxxx>
>> Signed-off-by: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx>

>> diff --git a/arch/ia64/kernel/signal.c b/arch/ia64/kernel/signal.c
>> index a199be1..37dd795 100644
>> --- a/arch/ia64/kernel/signal.c
>> +++ b/arch/ia64/kernel/signal.c
>> @@ -220,7 +220,7 @@ ia64_rt_sigreturn (struct sigscratch *scr)
>>  	si.si_errno = 0;
>>  	si.si_code = SI_KERNEL;
>>  	si.si_pid = task_pid_vnr(current);
>> -	si.si_uid = current_uid();
>> +	si.si_uid = from_kuid_munged(current_user_ns(), current_uid());
> Question: why use current_user_ns not the init_user_ns here?

Because the value is going to userspace and we want the userspace
value.

This is much less clear than I would like it.  In my ideal world we
would keep this value as a kuid_t right up until we perform the copy
to userspace.  Unfortunately I wasn't able to figure out to make
that happen.

However since this value is destined for user space there would
never be a reason to use &init_user_ns.  Values either stay
a kuid_t or are converted into the user namespace userspace needs.

Eric

_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.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