9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: arisawa <arisawa@ar.aichi-u.ac.jp>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] unmount
Date: Tue,  1 Dec 2015 18:39:11 +0900	[thread overview]
Message-ID: <59EA2A73-3E31-413E-8037-1D3BE16B2CC4@ar.aichi-u.ac.jp> (raw)
In-Reply-To: <491F5E4C-E68D-44A5-81A5-1C6BC5E8DC96@ar.aichi-u.ac.jp>

I said:

> 2015/12/01 12:24、arisawa <arisawa@ar.aichi-u.ac.jp> のメール:
> 
> Hello 9fans,
> 
> current kernel allows unmount even if after rfork m.
> this feature makes sandboxing difficult.
> can anyone explain this feature is necessary?
> 
> Kenji Arisawa

I make a protection for unmounting after rfork -m and now testing.
my idea is: protecting unmount with a single argument.
it seems the following code is working, however I am not sure this is OK.
any comment welcome.

/sys/src/9/port/sysfile.c:

sysunmount(va_list list)
{
	Chan *cmount, *cmounted;
	char *name, *old;

	name = va_arg(list, char*);
	old = va_arg(list, char*);

	/*	a protection for 'unmount' after 'rfork m'
	*	we can reject any unmount, however it might not be user friendly to do so.
	*	more moderate way might be disallowing
	*		unmount mntpoint	# sigle argument
	*	it is ideal though: we disalow unmount dirs that are mounted before rfork m.
	*	probably we need this protection also in regular kernel
	*
	*	print("name=%s old=%s\n",name,old);
	*	the output is, e.g,
	*	name=srv/factorum
	*	old=/mnt
	*	-Kenar-	*/

	if(up->pgrp->noattach && (name == nil)){
		error(Eperm);
		return 0;
	}





  reply	other threads:[~2015-12-01  9:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-01  3:24 arisawa
2015-12-01  9:39 ` arisawa [this message]
2015-12-01 17:06 ` Charles Forsyth
  -- strict thread matches above, loose matches on Subject: below --
2003-02-24 19:51 rog
2003-02-24 20:08 ` rob pike, esq.

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=59EA2A73-3E31-413E-8037-1D3BE16B2CC4@ar.aichi-u.ac.jp \
    --to=arisawa@ar.aichi-u.ac.jp \
    --cc=9fans@9fans.net \
    /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;
as well as URLs for NNTP newsgroup(s).