]> git.baikalelectronics.ru Git - kernel.git/commit
selinux: enable per-file labeling for debugfs files.
authorStephen Smalley <sds@tycho.nsa.gov>
Thu, 4 Jun 2015 20:22:17 +0000 (16:22 -0400)
committerPaul Moore <pmoore@redhat.com>
Thu, 4 Jun 2015 20:22:17 +0000 (16:22 -0400)
commita77fd74f6c4db79b8a55a08549715a0425600de4
treebd4d47b5287f2b3e846d377e21bb5ad77486d774
parentfde0743d5bda3fefd3f555f1ae31f5fcc47bc141
selinux: enable per-file labeling for debugfs files.

Add support for per-file labeling of debugfs files so that
we can distinguish them in policy.  This is particularly
important in Android where certain debugfs files have to be writable
by apps and therefore the debugfs directory tree can be read and
searched by all.

Since debugfs is entirely kernel-generated, the directory tree is
immutable by userspace, and the inodes are pinned in memory, we can
simply use the same approach as with proc and label the inodes from
policy based on pathname from the root of the debugfs filesystem.
Generalize the existing labeling support used for proc and reuse it
for debugfs too.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Paul Moore <pmoore@redhat.com>
security/selinux/hooks.c
security/selinux/include/security.h