[lkml]   [2012]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH] nextfd(2)
    On Sun, Apr 1, 2012 at 15:03, H. Peter Anvin <> wrote:
    > On 04/01/2012 05:57 AM, Alexey Dobriyan wrote:
    >> * /proc/self/fd is unreliable:
    >>   proc may be unconfigured or not mounted at expected place.
    >>   Looking at /proc/self/fd requires opening directory
    >>   which may not be available due to malicious rlimit drop or ENOMEM situations.
    >>   Not opening directory is equivalent to dumb close(2) loop except slower.
    > This is really the motivation for this... the real question is how much
    > functionality is actually available in the system without /proc mounted,
    > and in particular if this particular subcase is worth optimizing ...
    > after all, if someone is maliciously setting rlimit, we can just abort
    > (if someone can set an rlimit they can also force an abort) or revert to
    > the slow path.

    Well, I imagine one typical usecase for closing all FDs is for
    security isolation purposes (EG: chroot()+etc), and in a great deal of
    chroot environments you don't have /proc available. In particular
    /proc has been a source of a lot of privilege escalations in the past,
    so avoiding mounting it in a chroot is good security policy if

    Kyle Moffett
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2012-04-02 03:21    [W:0.020 / U:176.292 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site