All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Beshers <gbeshers@comcast.net>
To: David Dabbs <david@dabbs.net>
Cc: Hans Reiser <reiser@namesys.com>, reiserfs-list@namesys.com
Subject: Re: viewprinting: what format should views be stored in?
Date: Thu, 19 Aug 2004 10:30:58 -0400	[thread overview]
Message-ID: <4124B9A2.3000909@comcast.net> (raw)
In-Reply-To: <20040819074027.8429715D94@mail03.powweb.com>

[-- Attachment #1: Type: text/plain, Size: 7584 bytes --]



David Dabbs wrote:

>
>
>Questions
>----------------------------------------------------------------------
>  
>
>>All file types and access methods will be supported, yes? 
>>(mmap, AIO, DIRECT, pipes, hard/sym links, etc.)
>>
>>Hans: Yes.
>>...except that they cannot create hard links (above)
>>    
>>
>
>Is this restriction unequivocal (yes)? 
>Any other forbidden Unix fs objects or fs operations?
>
>  
>
It needs further study which Hans and I have agreed to postpone
until after we have something working.

>  
>
>>Early on in the conversation, there was discussion about 
>>"permissible functionality." At a minimum, a mask, true to its name, 
>>will effect filesystem object _visibility_. It was not completely 
>>clear whether the mask will be proscriptive viz operations. IOW, will 
>>the mask say that fooprocess "is not permitted to [attempt to] RWX 
>>object bar?" I believe this is not something masks will do, but I 
>>wanted clarification.
>>
>>
>>I don't know why I don't understand your question, but I don't.....;-)
>>    
>>
>
>
>Let me try again. At a mininmum, a mask specifies what objects are
>visible to a process, correct? If objext X is included in or not 
>explicitly excluded from the mask, then fooprocess is allowed to 
>_attempt_to_ operate on object X. I say "attempt to" because, at 
>that point (fall-through), the mask is finished wrt the operation, 
>yes? Permission to actually carry out an operation on object X is 
>determined by the user/object/permission mapping in the underlying
>filesystem.
>
>What was not clear to me was whether masks specified, proscribed, or
>in any way controlled filesystem operations (permissions) for objects
>that are visible when running under the mask. If so, what can be 
>specified and is it an "allow" a "deny" or either?
>  
>
The answer is yes... but the extent of the control is an open question.

 - We have agreed not to mess with UIDs and GIDs or the associated
    set-uid and set-gid bits for the moment.
 - We have agreed that a mask which limits the operations on a visible
   file is appropriate, e.g., read-only should be supported.

Beyond that we will be driven largely by the perceived utility of the
functionality within the context of usual software engineering concerns.

>
>  
>
>>Hans, in your preferred approach you referred to "a format that 
>>is as if it is a subdirectory of the masked executable." Did you have
>>in mind checking for something like /usr/bin/fooprocess/metas/mask 
>>when exec() loads the exe,
>>
>>yes
>>
>>and if this exists then the files rooted in this directory 
>>would be set as the process's root filesystem?
>>
>>Your statement is imprecise. The mask will be checked first, and 
>>then iff it falls through we do a normal filesystem traversal.
>>    
>>
>
>It was imprecise because perhaps I had a different vprint concept 
>and implementation in mind. Using the creation tool, JAdmin creates 
>a mask for fooprocess. The mask would be a directory structure 
>rooted at /bin/fooprocess/metas/mask. All files (not dirs) in 
>this tree would be hard links to the "real" files specified in the mask. 
>Only dirs & files included in the spec are visible. When an instance of 
>fooprocess is started, /bin/fooprocess/metas/mask is automagically mounted 
>as the process's root filesystem. The mask would be the filesystem. 
>Other than the use of the metas reiserism (and mask maintenance wizardry)
>this is not any different than chroot. Since the end result here is
>to be no more secure than chroot, but very much easier to deploy and 
>maintain, is there a reason why this cannot be the case?
>  
>
Well, I had not planned on the hard links in particular---this is where 
the fall
through semantics seem to be correct.  Suppose there are 1000 masks and
a new file gets added are you planning to add 1000 links?

>  
>
>>you can insert a search of the mask tree. If the 
>>search fails, then it is not excluded and the request falls through 
>>to normal VFS handling. In the /etc/passwd case above, it would find 
>>/etc/passwd and so the file is excluded. Processing would stop there, 
>>returning some error. How does this sound? 
>>
>>I don't quite understand this paragraph above.
>>    
>>
>
>
>Probably because I'm not on the same page as you and George.
>Imagine a filesystem with two trees: one, the real
>root filesystem and two, the anti-root tree (exclusions). This
>fs would be the root fs for the process. Let's say fooprocess has 
>the following exclusions:
>
>	/etc/passwd
>	/etc/shadow
>	/var
>
>Above, when I said "insert a search of the mask tree" what I meant was
>"first search the exception [semantic] tree (anti-tree) associated with 
>this process. If you find the object there, then report it as NOT FOUND.
>Otherwise, proceed with a normal fs tree search (fall-through). Basically,
>a dynamic, per-process (er, per mask) hidden attribute. The modified VFS 
>code to store the dentry of the root of the mask base dir, then use 
>normal namei(), etc. path resolution interfaces to see if the file exists 
>in the exception list? IOW, when fooprocess attempts to open /etc/passwd 
>when fooprocess is under the above mask, the following happens: VFS 
>identifies process as being undermask and so knows dentry of the base dir 
>of the exception list (fooprocess/metas/mask). Before doing 'normal' 
>handling, VFS treats this as a request to operate on 
>fooprocess/metas/mask/etc/passwd. If VFS finds the filename, then NOT 
>FOUND is returned. Otherwise, file processing proceeds normally.
>  
>
This is closer to my understanding.

>>George:
>>To give a couple of examples:
>>    1) A given process (say a restricted shell) can not exec() an
>>        executable with the set-uid bit on.
>>         - directly
>>         - indirectly (e.g., via bash)
>>    2) Apache can only create/write files in /var/web/incoming.
>>         - files created or modified can not have any execute bit set 
>>and executing chmod is excluded.
>>
>>Hans:
>>this protection happens while traversing the mask or at the fall through 
>>point.  Hmmm, we need to accumulate a set of permissions that apply to 
>>something that are specific to how we got there.  That could be complex 
>>in the VFS details.  We can defer it to Phase II if necessary.  George, 
>>you should spend a day (not this week) figuring out how much work it 
>>would be to make that work.  It will be the details of it that will be 
>>dangerous....
>>    
>>
>
>I'll tackle scenario #2:
>* Executing chmod would be excluded because it would not be visible in the mask.
>  
>
    Note that, at some point, one would like to disallow chmod() and 
fchmod() in any
    child process---but this is beyond the scope or the current project.

>* "files created or modified can not have any execute bit set" 
>  Implicit in this statement is that, in addition to filtering object 
>  visibility, masks will preempt/proscribe certain fs operations -- in this 
>  case, the setting of certain attributes (i.e. exec bit). If this is correct
>  then what can masks allow/prohibit WRT operations/attributes performed
>  on objects. This is what I was trying to clarify with my earlier question.
>
>  
>
    Let us say that, as this example suggests, it would make the masking 
more
    powerful and more useful since allowing someone on the internee to 
store data
    on your disk is much less risky than allowing them to get a process 
running
    over which they have control.

    That a viable and scalable implementation of this can be developed 
is an open
     question---currently ;-)


[-- Attachment #2: Type: text/html, Size: 9058 bytes --]

  parent reply	other threads:[~2004-08-19 14:30 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-19  7:40 viewprinting: what format should views be stored in? David Dabbs
2004-08-19 11:21 ` David Greaves
2004-08-19 16:16   ` George Beshers
2004-08-20  6:19     ` Hans Reiser
2004-10-26 14:45       ` Lamont R. Peterson
2004-10-26 16:39         ` Hans Reiser
2004-10-26 16:57           ` George Beshers
2004-10-26 18:37             ` Hans Reiser
2004-10-26 20:20               ` George Beshers
2004-10-27  4:48                 ` Hans Reiser
     [not found]   ` <4124D09A.1060208@comcast.net>
2004-08-19 17:31     ` David Greaves
2004-08-20  6:52       ` Hans Reiser
2004-08-20 12:08         ` George Beshers
2004-08-20 14:07         ` David Greaves
2004-10-26 15:54         ` Lamont R. Peterson
2004-10-27  1:04           ` David Masover
2004-08-20  6:13   ` Hans Reiser
2004-08-19 14:30 ` George Beshers [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-08-22  5:45 David Dabbs
2004-08-21 20:48 David Dabbs
2004-08-21  7:38 David Dabbs
2004-08-21  8:59 ` Hans Reiser
2004-08-20 22:29 David Dabbs
2004-08-20 17:14 David Dabbs
2004-08-20  7:23 David Dabbs
2004-08-20 16:10 ` Valdis.Kletnieks
2004-08-20 21:04   ` George Beshers
2004-08-21  6:42     ` Hans Reiser
2004-08-18  7:52 David Dabbs
2004-08-18 18:37 ` David Masover
2004-08-18 21:47   ` George Beshers
2004-08-18 19:20 ` George Beshers
2004-08-18 20:20   ` Hans Reiser
2004-08-18 21:44     ` George Beshers
2004-08-18 21:48       ` Hans Reiser
2004-08-18 23:18         ` George Beshers
2004-08-19  0:42           ` Hans Reiser
2004-08-19  2:01             ` George Beshers
2004-08-19  5:50               ` Hans Reiser
2004-08-19 12:48                 ` George Beshers
2004-08-20  6:59                   ` Hans Reiser
2004-08-20 12:36                     ` George Beshers
2004-08-20 18:14                       ` Hans Reiser
2004-08-20 21:42                         ` George Beshers
2004-08-18 19:34 ` Hans Reiser
2004-08-16  0:15 Hans Reiser
2004-08-16  1:48 ` George Beshers
2004-08-16  2:02   ` Hans Reiser
2004-08-16 13:47     ` George Beshers
2004-08-16 19:50     ` George Beshers
2004-08-17  7:07       ` Hans Reiser
2004-08-17 19:29         ` George Beshers
2004-08-17 20:28           ` Hans Reiser
2004-08-17 23:46             ` George Beshers
2004-08-18  2:22               ` Hans Reiser
     [not found]         ` <4121F4D6.8090506@comcast.net>
2004-08-17 19:43           ` Hans Reiser

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=4124B9A2.3000909@comcast.net \
    --to=gbeshers@comcast.net \
    --cc=david@dabbs.net \
    --cc=reiser@namesys.com \
    --cc=reiserfs-list@namesys.com \
    /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.