lkml.org 
[lkml]   [2012]   [Jan]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH] Add PR_{GET,SET}_NO_NEW_PRIVS to prevent execve from granting privs
    On Tue, Jan 17, 2012 at 3:57 PM, Eric W. Biederman
    <ebiederm@xmission.com> wrote:
    > Andy Lutomirski <luto@amacapital.net> writes:
    >
    >> With this set, a lot of dangerous operations (chroot, unshare, etc)
    >> become a lot less dangerous because there is no possibility of
    >> subverting privileged binaries.
    >>
    >> This patch completely breaks apparmor.  Someone who understands (and
    >> uses) apparmor should fix it or at least give me a hint.
    >
    > Foolish implementation question.
    >
    > Is there a reason why we are putting this in a new field in the task
    > struct instead of adding a new flag in securebits in struct cred?

    Linus said:

    I think it almost has to be task state, since we very much want to
    make sure it's trivial to see that nothing ever clears that bit, and
    that it always gets copied right over a fork/exec/whatever.

    Putting it in some cred or capability bit or somethin would make that
    kind of transparency pretty much totally impossible.


    I personally don't care that much.

    >
    > It seems to me like putting this information on the task_struct instead
    > of struct cred will tend to make this frozen state transition less
    > discoverable for future developers.
    >
    > Also I would expect if you were applying this policy that you would
    > to ensure that task->read_cred == task->cred.

    What sets cred to something other than real_cred.

    >
    > Do we want to disable setuid() and it's friends as well?  Certainly
    > freezing everything at exec is good I'm just wondering if handling
    > the handful of other cases where we explicitly change the permissions
    > on a process might be interesting.

    I still think we shouldn't. If you want to disable setuid, just turn
    off CAP_SETUID. The ability to setuid (the syscall, not the mode bit)
    doesn't make things like seccomp and chroot more dangerous. And I
    need setuid if I want to implement my hypothetical pam_no_new_privs.

    --Andy
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2012-01-18 01:25    [W:0.022 / U:0.784 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site