public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vasiliy Kulikov <segoon@openwall.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "Arkadiusz Miśkiewicz" <a.miskiewicz@gmail.com>,
	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:27:36 +0400	[thread overview]
Message-ID: <20120325152736.GB4391@albatros> (raw)
In-Reply-To: <20120323161504.dced28b9.akpm@linux-foundation.org>

On Fri, Mar 23, 2012 at 16:15 -0700, Andrew Morton wrote:
> I'm surprised.  "mount -o remount,<options>" doesn't work on a mounted
> procfs, and nobody noticed until now?
> 
> The patch looks OK - has it been tested with both valid and invalid
> mount options?
> 
> 
> I redid the changelog:
> 
> 
> From: Vasiliy Kulikov <segoon@openwall.com>
> Subject: proc: fix mount -t proc -o AAA
> 
> The proc_parse_options() call from proc_mount() runs only once at boot
> time.  So on any later mount attempt, any mount options are ignored
> because ->s_root is already initialized.
> 
> As a consequence, "mount -o remount,<options>" will ignore the options.

No, remount works as it should.  _mount_ doesn't work.  Why it was not spotted:
Live case is:

1) upstart and systemd don't use /etc/fstab for /proc when mounting it at
the boot time.
2) dbus, etc. use /proc/ from the boot, so /proc cannot be umounted without
dbus stop.

So, to apply hidepid=X without system reboot procfs should be remounted
instead of umount+mount.

> To fix this, parse the mount options unconditionally.

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

  parent reply	other threads:[~2012-03-25 15:27 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
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 [this message]
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=20120325152736.GB4391@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox