lkml.org 
[lkml]   [2003]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    Subjectpatch for open file handles with initrd in 2.4.20
    From
    The following patch was back-ported from 2.5.x by Stephen Smalley to fix a
    problem where the file handle of the root of the initrd is inherited by init
    and other processes.

    The bug was discovered when running SE Linux on 2.4.20 systems with a policy
    that denied such inheriting of file handles and logged the operations it
    denied.

    This patch has been well tested, please include it in 2.4.21.


    --- linux-2.4.20.lsm-old/init/do_mounts.c 2002-12-13 19:33:23.000000000 +0100
    +++ linux-2.4.20.lsm/init/do_mounts.c 2002-12-13 19:36:48.000000000 +0100
    @@ -812,6 +812,8 @@
    /* switch root and cwd back to / of rootfs */
    sys_fchdir(root_fd);
    sys_chroot(".");
    + close(old_fd);
    + close(root_fd);
    sys_umount("/old/dev", 0);

    if (real_root_dev == ram0) {
    -
    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: 2005-03-22 13:32    [W:3.097 / U:0.000 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site