Re: permissive vs. restrictive issue and solutions...

From: David Wagner (dawat_private)
Date: Fri Jun 08 2001 - 16:24:24 PDT

  • Next message: David Wagner: "Re: permissive vs. restrictive issue and solutions..."

    Chris Wright  wrote:
    >What do we do with complex logic like (arch/i386/kernel/ptrace.c):
    >
    >if(((current->uid != child->euid) ||
    >   (current->uid != child->suid) ||
    >   (current->uid != child->uid) ||
    >   (current->gid != child->egid) ||
    >   (current->gid != child->sgid) ||
    >   (!cap_issubset(child->cap_permitted, current->cap_permitted)) ||            
    >   (current->gid != child->gid)) && !capable(CAP_SYS_PTRACE))
    >      goto out_tsk;
    >rmb();
    >if (!child->dumpable && !capable(CAP_SYS_PTRACE))
    >   goto out_tsk;
    
    Can the following be used instead?
    
    no_ptrace = security_ops->ptrace_hook(...);
    if (no_ptrace)
        goto out_tsk;
    if(((current->uid != child->euid) ||
       (current->uid != child->suid) ||
       (current->uid != child->uid) ||
       (current->gid != child->egid) ||
       (current->gid != child->sgid) ||
       (!cap_issubset(child->cap_permitted, current->cap_permitted)) ||            
       (current->gid != child->gid)) && !capable(CAP_SYS_PTRACE))
          goto out_tsk;
    rmb();
    if (!child->dumpable && !capable(CAP_SYS_PTRACE))
       goto out_tsk;
    
    What am I missing?
    
    _______________________________________________
    linux-security-module mailing list
    linux-security-moduleat_private
    http://mail.wirex.com/mailman/listinfo/linux-security-module
    



    This archive was generated by hypermail 2b30 : Fri Jun 08 2001 - 16:27:28 PDT