]> bbs.cooldavid.org Git - net-next-2.6.git/commit - mm/shmem.c
[PATCH] tmpfs: Enable atomic inode security labeling
authorStephen Smalley <sds@tycho.nsa.gov>
Fri, 9 Sep 2005 20:01:43 +0000 (13:01 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 9 Sep 2005 20:57:28 +0000 (13:57 -0700)
commit570bc1c2e5ccdb408081e77507a385dc7ebed7fa
treed00d2df7c93899fa2028128c40961fec46ede471
parentac50960afa31877493add6d941d8402fa879c452
[PATCH] tmpfs: Enable atomic inode security labeling

This patch modifies tmpfs to call the inode_init_security LSM hook to set
up the incore inode security state for new inodes before the inode becomes
accessible via the dcache.

As there is no underlying storage of security xattrs in this case, it is
not necessary for the hook to return the (name, value, len) triple to the
tmpfs code, so this patch also modifies the SELinux hook function to
correctly handle the case where the (name, value, len) pointers are NULL.

The hook call is needed in tmpfs in order to support proper security
labeling of tmpfs inodes (e.g.  for udev with tmpfs /dev in Fedora).  With
this change in place, we should then be able to remove the
security_inode_post_create/mkdir/...  hooks safely.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
mm/shmem.c
security/selinux/hooks.c