lkml.org 
[lkml]   [2012]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Subject3.3 and hidepid feature problem - options not always applied at mount
    Date

    Hi,

    I'm trying to use hidepid feature in 3.3 kernel but I'm getting weird
    things like options not being applied _sometimes_ at mount.

    [@ ~]# cat /proc/mounts
    sh: cat: /proc/mounts: No such file or directory
    [@ ~]# strace -e mount -f -F -s 200 mount none /proc -t proc -o hidepid=2,gid=17
    mount("none", "/proc", "proc", MS_MGC_VAL, "hidepid=2,gid=17") = 0
    [@ ~]# cat /proc/mounts
    rootfs / rootfs rw 0 0
    /dev/sda3 / xfs rw,relatime,attr2,noquota 0 0
    run /run tmpfs rw,relatime 0 0
    none /proc proc rw,relatime 0 0

    No hidepid, no gid - huh?

    [@ ~]# mount /proc -o remount,hidepid=2,gid=17
    [@ ~]# cat /proc/mounts
    rootfs / rootfs rw 0 0
    /dev/sda3 / xfs rw,relatime,attr2,noquota 0 0
    run /run tmpfs rw,relatime 0 0
    none /proc proc rw,relatime,gid=17,hidepid=2 0 0

    remount and hidepid/gid is there

    [@ ~]# umount /proc
    [@ ~]# strace -e mount -f -F -s 200 mount none /proc -t proc -o hidepid=2,gid=17
    mount("none", "/proc", "proc", MS_MGC_VAL, "hidepid=2,gid=17") = 0
    [@ ~]# cat /proc/mounts
    rootfs / rootfs rw 0 0
    /dev/sda3 / xfs rw,relatime,attr2,noquota 0 0
    run /run tmpfs rw,relatime 0 0
    none /proc proc rw,relatime,gid=17,hidepid=2 0 0

    and now I'm lost - every new umount & mount gets hidepid/gid right.

    Any ideas why initial mount fails to get hidepid/gid options applied?
    The syscall seems correct.
    --
    Arkadiusz Miśkiewicz PLD/Linux Team
    arekm / maven.pl http://ftp.pld-linux.org/
    --
    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-03-22 09:05    [W:0.041 / U:31.668 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site