Re: [PATCH] BSD Secure Levels: claim block dev in file struct rather than inode struct, 2.6.11-rc2-mm1 (3/8)

2005-02-08 Thread Chris Wright
* Michael Halcrow ([EMAIL PROTECTED]) wrote: > [...]. This occurs because the bd_release function will > bd_release(bdev) and set inode->i_security to NULL on the close(fd1). > Hence, we want to place the control at the level of the file struct, > not the inode. This is basically what I was refer

Re: [PATCH] BSD Secure Levels: claim block dev in file struct rather than inode struct, 2.6.11-rc2-mm1 (3/8)

2005-02-08 Thread Serge E. Hallyn
Quoting [EMAIL PROTECTED] ([EMAIL PROTECTED]): > On Tue, 08 Feb 2005 11:24:50 CST, Michael Halcrow said: > > > While the program is waiting for a keystroke, mount the block device. > > Enter a keystroke. The result without the patch is 1, which is a > > security violation. This occurs because th

Re: [PATCH] BSD Secure Levels: claim block dev in file struct rather than inode struct, 2.6.11-rc2-mm1 (3/8)

2005-02-08 Thread Valdis . Kletnieks
On Tue, 08 Feb 2005 11:24:50 CST, Michael Halcrow said: > While the program is waiting for a keystroke, mount the block device. > Enter a keystroke. The result without the patch is 1, which is a > security violation. This occurs because the bd_release function will > bd_release(bdev) and set ino

Re: [PATCH] BSD Secure Levels: claim block dev in file struct rather than inode struct, 2.6.11-rc2-mm1 (3/8)

2005-02-08 Thread Michael Halcrow
On Mon, Feb 07, 2005 at 02:26:03PM -0800, Chris Wright wrote: > * Michael Halcrow ([EMAIL PROTECTED]) wrote: > > This is the third in a series of eight patches to the BSD Secure > > Levels LSM. It moves the claim on the block device from the inode > > struct to the file struct in order to address

Re: [PATCH] BSD Secure Levels: claim block dev in file struct rather than inode struct, 2.6.11-rc2-mm1 (3/8)

2005-02-08 Thread David Wagner
>The attack is to hardlink some tempfile name to some file you want >over-written. This usually involves just a little bit of work, such as >recognizing that a given root cronjob uses an unsafe predictable filename >in /tmp (look at the Bugtraq or Full-Disclosure archives, there's plenty). >Then y

Re: [PATCH] BSD Secure Levels: claim block dev in file struct rather than inode struct, 2.6.11-rc2-mm1 (3/8)

2005-02-07 Thread Valdis . Kletnieks
On Mon, 07 Feb 2005 18:20:36 PST, Chris Wright said: > * [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote: > > open("/tmp/sh-thd-1107848098", O_WRONLY|O_CREAT|O_TRUNC|O_EXCL|O_LARGEFILE, 0600) = 3 > > O_EXCL > > > Wow - if my /tmp was on the same partition, and I'd hard-linked that > > file to /etc/p

Re: [PATCH] BSD Secure Levels: claim block dev in file struct rather than inode struct, 2.6.11-rc2-mm1 (3/8)

2005-02-07 Thread Chris Wright
* [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote: > open("/tmp/sh-thd-1107848098", O_WRONLY|O_CREAT|O_TRUNC|O_EXCL|O_LARGEFILE, > 0600) = 3 O_EXCL > Wow - if my /tmp was on the same partition, and I'd hard-linked that > file to /etc/passwd, it would be toast now if root had run it. So, in fact, it

Re: [PATCH] BSD Secure Levels: claim block dev in file struct rather than inode struct, 2.6.11-rc2-mm1 (3/8)

2005-02-07 Thread Valdis . Kletnieks
On Tue, 08 Feb 2005 01:48:40 GMT, David Wagner said: > How would /etc/passwd get clobbered? Are you thinking that a tmp > cleaner run by cron might delete /tmp/whatever (i.e., delete the hardlink > you created above)? But deleting /tmp/whatever is safe; it doesn't affect > /etc/passwd. I'm gues

Re: [PATCH] BSD Secure Levels: claim block dev in file struct rather than inode struct, 2.6.11-rc2-mm1 (3/8)

2005-02-07 Thread David Wagner
>For those systems that have everything on one big partition, you can often >do stuff like: > >ln /etc/passwd /tmp/ > >and wait for /etc/passwd to get clobbered by a cron job run by root... How would /etc/passwd get clobbered? Are you thinking that a tmp cleaner run by cron might delete /tmp/what

Re: [PATCH] BSD Secure Levels: claim block dev in file struct rather than inode struct, 2.6.11-rc2-mm1 (3/8)

2005-02-07 Thread Valdis . Kletnieks
On Mon, 07 Feb 2005 14:26:03 PST, Chris Wright said: > * Michael Halcrow ([EMAIL PROTECTED]) wrote: > > This is the third in a series of eight patches to the BSD Secure > > Levels LSM. It moves the claim on the block device from the inode > > struct to the file struct in order to address a potenti

Re: [PATCH] BSD Secure Levels: claim block dev in file struct rather than inode struct, 2.6.11-rc2-mm1 (3/8)

2005-02-07 Thread Valdis . Kletnieks
On Mon, 07 Feb 2005 14:26:03 PST, Chris Wright said: > Hard links still point to same inode, what's the issue that this > addresses? For those systems that have everything on one big partition, you can often do stuff like: ln /etc/passwd /tmp/ and wait for /etc/passwd to get clobbered by a cron

Re: [PATCH] BSD Secure Levels: claim block dev in file struct rather than inode struct, 2.6.11-rc2-mm1 (3/8)

2005-02-07 Thread Chris Wright
* Michael Halcrow ([EMAIL PROTECTED]) wrote: > This is the third in a series of eight patches to the BSD Secure > Levels LSM. It moves the claim on the block device from the inode > struct to the file struct in order to address a potential > circumvention of the control via hard links to block dev

[PATCH] BSD Secure Levels: claim block dev in file struct rather than inode struct, 2.6.11-rc2-mm1 (3/8)

2005-02-07 Thread Michael Halcrow
This is the third in a series of eight patches to the BSD Secure Levels LSM. It moves the claim on the block device from the inode struct to the file struct in order to address a potential circumvention of the control via hard links to block devices. Thanks to Serge Hallyn for pointing this out.