From: "Kristian Sørensen" <ks@cs.aau.dk>
To: Christoph Hellwig <hch@infradead.org>
Cc: umbrella-devel@lists.sourceforge.net,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [Umbrella-devel] Re: Getting full path from dentry in LSM hooks
Date: Fri, 03 Sep 2004 21:54:23 +0200 [thread overview]
Message-ID: <4138CBEF.9000909@cs.aau.dk> (raw)
In-Reply-To: <20040903150111.A4884@infradead.org>
Christoph Hellwig wrote:
> On Fri, Sep 03, 2004 at 03:20:55PM +0200, Kristian Sørensen wrote:
>
>>But we do not have a struct file - just an inode or a dentry :((
>
>
> Then you can't generate a full path.
>
>
>>We are working on a project called Umbrella, (umbrella.sf.net) which
>>implements processbased mandatory accesscontrol in the Linux kernel.
>>This access control is controlled by "restriction", e.g. by restricting
>> some process from accessing any given file or directory.
>>
>>E.g. if a root owned process is restricted from accessing /var/www, and
>>the process is compromised by an attacker, no mater what he does, he
>>would not be able to access this directory.
>
>
> mount --bind /var/www /home/joe/p0rn/, and then?
Actually this "attack" is avoided, because restrictions are enherited,
from parent proces to its children.
Okay, this is how it works in basic:
------------------
ks@qbox:~/umbrella-devel/userspace
$ touch /tmp/a
ks@qbox:~/umbrella-devel/userspace
$ ./umbrella_restricted_sh
sh-2.05b$ touch /tmp/a
touch: setting times of `/tmp/a': Operation not permitted
sh-2.05b$ exit
Restricted child died
Thank you for testing!
Concider joining the development at http://umbrella.sourceforge.net
------------------
- the "umbrella_restricted_sh" just forks a new shell, which is
restricted from /tmp
Now let's try your suggestion:
------------------------
root@qbox:~/umbrella-devel/userspace
$ id
uid=0(root) gid=0(root)
groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),20(dialout),26(tape),27(video)
root@qbox:~/umbrella-devel/userspace
$ mkdir new-tmp
root@qbox:~/umbrella-devel/userspace
$ mount --bind /tmp new-tmp
root@qbox:~/umbrella-devel/userspace
$ mount
/dev/discs/disc1/part2 on / type ext3 (rw)
none on /dev type devfs (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw)
/dev/discs/disc0/part1 on /home type ext3 (rw)
/dev/discs/disc0/part2 on /media type ext3 (rw)
none on /dev/shm type tmpfs (rw)
none on /proc/bus/usb type usbfs (rw)
/tmp on /home/ks/umbrella-devel/userspace/new-tmp type none (rw,bind)
root@qbox:~/umbrella-devel/userspace
$ ./umbrella_restricted_sh
sh-2.05b# touch /tmp/a
touch: setting times of `/tmp/a': Operation not permitted
sh-2.05b# touch new-tmp/a
touch: setting times of `new-tmp/a': Operation not permitted
sh-2.05b# ls new-tmp/
ls: new-tmp/: Operation not permitted
sh-2.05b# exit
Restricted child died
Thank you for testing!
Concider joining the development at http://umbrella.sourceforge.net
------------------------
As you can see, the bind-mount fails to succeed in accessing the files
in /tmp.
Best regards, Kristian.
next prev parent reply other threads:[~2004-09-03 19:59 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-03 12:12 Getting full path from dentry in LSM hooks Kristian Sørensen
2004-09-03 12:32 ` Christoph Hellwig
2004-09-03 12:38 ` [Umbrella-devel] " Kristian Sørensen
2004-09-03 13:04 ` Christoph Hellwig
2004-09-03 13:20 ` Kristian Sørensen
2004-09-03 14:01 ` Christoph Hellwig
2004-09-03 19:54 ` Kristian Sørensen [this message]
2004-09-04 11:09 ` Christoph Hellwig
2004-09-04 18:52 ` Kristian Sørensen
2004-09-03 15:38 ` Stephen Smalley
2004-09-03 12:43 ` Andrea Arcangeli
2004-09-03 14:14 ` Alan Cox
2004-09-03 20:05 ` [Umbrella-devel] " Kristian Sørensen
2004-09-03 20:39 ` Valdis.Kletnieks
2004-09-04 9:06 ` Kristian Sørensen
2004-09-04 10:50 ` Emmanuel Fleury
2004-09-07 14:19 ` Kristian Sørensen
2004-09-04 2:41 ` Horst von Brand
2004-09-04 19:01 ` Kristian Sørensen
2004-09-04 19:06 ` Kristian Sørensen
2004-09-04 16:56 ` Alan Cox
2004-09-04 18:47 ` Kristian Sørensen
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=4138CBEF.9000909@cs.aau.dk \
--to=ks@cs.aau.dk \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=umbrella-devel@lists.sourceforge.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