All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vasiliy Kulikov <segoon@openwall.com>
To: "Arkadiusz Miśkiewicz" <a.miskiewicz@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org,
	Alexey Dobriyan <adobriyan@gmail.com>
Subject: Re: [PATCH] proc: fix mount -t proc -o AAA
Date: Sun, 25 Mar 2012 19:36:12 +0400	[thread overview]
Message-ID: <20120325153612.GC4391@albatros> (raw)
In-Reply-To: <201203250924.06908.a.miskiewicz@gmail.com>

On Sun, Mar 25, 2012 at 09:24 +0200, Arkadiusz Miśkiewicz wrote:
> but there is another problem - unmounting it and mounting without options 
> causes old option to persist:
> 
> # mount none /proc -t proc -o hidepid=2
> # umount /proc
> # mount none /proc -t proc
> # grep "/proc" /proc/mounts
> none /proc proc rw,relatime,hidepid=2 0 0
> 
> There should be no hidepid=2 now.

No, that's an expected behaviour.

Procfs is a special filesystem.  Mount options are not reset on each
mount(2) as you can mount procfs multiple times at different mount points
(/proc/, /aaa/proc/, etc.).  Each time you add mount options they are
applied to _each_ mount point because there is no per-mount point sb, but
there is a per pid_ns superblock: pid_ns itself.  All options are stored
at pid_ns.

When you mount it another time without any option nothing should change
at the old mount points.  When you umount the last mount point all mount
options are still stored.  When you mount it again old options are used
(unless you override them).

Thanks,

-- 
Vasiliy Kulikov
http://www.openwall.com - bringing security into open computing environments

  reply	other threads:[~2012-03-25 15:36 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-22  8:03 3.3 and hidepid feature problem - options not always applied at mount Arkadiusz Miśkiewicz
2012-03-23 17:10 ` [PATCH] proc: fix mount -t proc -o AAA Vasiliy Kulikov
2012-03-23 18:45   ` Arkadiusz Miśkiewicz
2012-03-23 19:18     ` Vasiliy Kulikov
2012-03-23 23:15   ` Andrew Morton
2012-03-25  7:24     ` Arkadiusz Miśkiewicz
2012-03-25 15:36       ` Vasiliy Kulikov [this message]
2012-03-25 17:40         ` Arkadiusz Miśkiewicz
2012-03-25 17:49           ` Vasiliy Kulikov
2012-03-25 22:23         ` Valdis.Kletnieks
2012-03-26 22:37           ` Andrew Morton
2012-03-31 13:55             ` [PATCH] proc: reset mount options after the last procfs umount Vasiliy Kulikov
2012-03-31 14:19               ` Arkadiusz Miśkiewicz
2012-03-31 15:20                 ` Vasiliy Kulikov
2012-03-31 15:31                   ` Arkadiusz Miśkiewicz
2012-03-31 15:46                     ` Vasiliy Kulikov
2012-03-26 22:35       ` [PATCH] proc: fix mount -t proc -o AAA Andrew Morton
2012-03-25 15:27     ` Vasiliy Kulikov
2012-03-31 13:51     ` Vasiliy Kulikov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120325153612.GC4391@albatros \
    --to=segoon@openwall.com \
    --cc=a.miskiewicz@gmail.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.