lkml.org 
[lkml]   [2012]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH 24/43] userns: Convert ptrace, kill, set_priority permission checks to work with kuids and kgids
    "Serge E. Hallyn" <serge@hallyn.com> writes:

    > Quoting Eric W. Beiderman (ebiederm@xmission.com):
    >> From: Eric W. Biederman <ebiederm@xmission.com>
    >>
    >> 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@xmission.com>
    >> ---

    >> @@ -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


    \
     
     \ /
      Last update: 2012-04-21 01:49    [W:0.048 / U:4.532 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site