All of lore.kernel.org
 help / color / mirror / Atom feed
* Genfscon and cramfs issue
@ 2008-10-15  1:50 korkishko Tymur
  2008-10-15 12:49 ` Stephen Smalley
  0 siblings, 1 reply; 3+ messages in thread
From: korkishko Tymur @ 2008-10-15  1:50 UTC (permalink / raw)
  To: SELinux, k.tymur

I have discovered an issue with using genfscon for labeling cramfs filesystem.

I have Linux kernel 2.6.26 with a patch from NSA that allows genfscon support of security contexts for directories/files (others than/ ). 
I use genfscon to label files/directories on cramfsfilesystem(read-only filesystem) that does not support xattr.  

Cramfs filesystem has following behavior: for two files with different names but with the same file content it assigns single inode.  
Example:
genfscon cramfs /usr/file_one       user_u:system_r:file_one_t
genfscon cramfs /usr/file_two       user_u:system_r:file_two_t 

file-one and file-two have the same content (e.g. Hello world).
file-one and file-two share the same inode on cramfs. 

As a result, two files might have the _same_ security context  - either ...:file_one_t or ...:file_two_t.
If file  /usr/file_one is accessed first, user_u:system_r:file_one_t is used for both files.
If file  /usr/file_two is accessed first, user_u:system_r:file_two_t is used for both files. 

Any ideas how to fix/deal with that issue are welcomed. 

---
Tymur Korkishko
Samsung Electronics


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Genfscon and cramfs issue
  2008-10-15  1:50 Genfscon and cramfs issue korkishko Tymur
@ 2008-10-15 12:49 ` Stephen Smalley
  2008-10-15 12:58   ` Stephen Smalley
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Smalley @ 2008-10-15 12:49 UTC (permalink / raw)
  To: k.tymur; +Cc: SELinux

On Wed, 2008-10-15 at 01:50 +0000, korkishko Tymur wrote:
> I have discovered an issue with using genfscon for labeling cramfs filesystem.
> 
> I have Linux kernel 2.6.26 with a patch from NSA that allows genfscon support of security contexts for directories/files (others than/ ). 
> I use genfscon to label files/directories on cramfsfilesystem(read-only filesystem) that does not support xattr.  
> 
> Cramfs filesystem has following behavior: for two files with different names but with the same file content it assigns single inode.  
> Example:
> genfscon cramfs /usr/file_one       user_u:system_r:file_one_t
> genfscon cramfs /usr/file_two       user_u:system_r:file_two_t 
> 
> file-one and file-two have the same content (e.g. Hello world).
> file-one and file-two share the same inode on cramfs. 
> 
> As a result, two files might have the _same_ security context  - either ...:file_one_t or ...:file_two_t.
> If file  /usr/file_one is accessed first, user_u:system_r:file_one_t is used for both files.
> If file  /usr/file_two is accessed first, user_u:system_r:file_two_t is used for both files. 
> 
> Any ideas how to fix/deal with that issue are welcomed. 

Why use two different security context for files that have the same
content?

-- 
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Genfscon and cramfs issue
  2008-10-15 12:49 ` Stephen Smalley
@ 2008-10-15 12:58   ` Stephen Smalley
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Smalley @ 2008-10-15 12:58 UTC (permalink / raw)
  To: k.tymur; +Cc: SELinux

On Wed, 2008-10-15 at 08:49 -0400, Stephen Smalley wrote:
> On Wed, 2008-10-15 at 01:50 +0000, korkishko Tymur wrote:
> > I have discovered an issue with using genfscon for labeling cramfs filesystem.
> > 
> > I have Linux kernel 2.6.26 with a patch from NSA that allows genfscon support of security contexts for directories/files (others than/ ). 
> > I use genfscon to label files/directories on cramfsfilesystem(read-only filesystem) that does not support xattr.  
> > 
> > Cramfs filesystem has following behavior: for two files with different names but with the same file content it assigns single inode.  
> > Example:
> > genfscon cramfs /usr/file_one       user_u:system_r:file_one_t
> > genfscon cramfs /usr/file_two       user_u:system_r:file_two_t 
> > 
> > file-one and file-two have the same content (e.g. Hello world).
> > file-one and file-two share the same inode on cramfs. 
> > 
> > As a result, two files might have the _same_ security context  - either ...:file_one_t or ...:file_two_t.
> > If file  /usr/file_one is accessed first, user_u:system_r:file_one_t is used for both files.
> > If file  /usr/file_two is accessed first, user_u:system_r:file_two_t is used for both files. 
> > 
> > Any ideas how to fix/deal with that issue are welcomed. 
> 
> Why use two different security context for files that have the same
> content?

Oh, and what is responsible for the aliasing of the files here - the
program that creates the cramfs image originally or the kernel's cramfs
filesystem implementation itself?

-- 
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-10-15 12:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-15  1:50 Genfscon and cramfs issue korkishko Tymur
2008-10-15 12:49 ` Stephen Smalley
2008-10-15 12:58   ` Stephen Smalley

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.