Re: [PATCH 24/43] userns: Convert ptrace, kill, set_priority permission checks to work with kuids and kgids

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

 



"Serge E. Hallyn" <serge@xxxxxxxxxx> writes:

> Quoting Eric W. Beiderman (ebiederm@xxxxxxxxxxxx):
>> From: Eric W. Biederman <ebiederm@xxxxxxxxxxxx>
>> 
>> Update the permission checks to use the new uid_eq and gid_eq helpers
>> and remove the now unnecessary user_ns equality comparison.
>> 
>> Signed-off-by: Eric W. Biederman <ebiederm@xxxxxxxxxxxx>
>> ---

>> @@ -1389,10 +1388,8 @@ static int kill_as_cred_perm(const struct cred *cred,
>>  			     struct task_struct *target)
>>  {
>>  	const struct cred *pcred = __task_cred(target);
>> -	if (cred->user_ns != pcred->user_ns)
>> -		return 0;
>> -	if (cred->euid != pcred->suid && cred->euid != pcred->uid &&
>> -	    cred->uid  != pcred->suid && cred->uid  != pcred->uid)
>> +	if (uid_eq(cred->euid, pcred->suid) && uid_eq(cred->euid, pcred->uid) &&
>
> These should be !uid_eq() right?
>> +	    uid_eq(cred->uid,  pcred->suid) && uid_eq(cred->uid,
>pcred->uid))

Yes.

Thank you for catching this.  This kind of mistake is unfortunately much
to easy to make.

Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux