Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 4822eb9b authored by Stephen Smalley's avatar Stephen Smalley Committed by alexax66
Browse files

selinux: enable per-file labeling for debugfs files.



upstream commit 6f29997f4a3117169eeabd41dbea4c1bd94a739c

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.

[sds:  Back-ported to 3.10.  superblock_security_struct flags field
is only unsigned char in 3.10 so we have to redefine SE_SBGENFS.
However, this definition is kernel-private, not exposed to userspace
or stored anywhere persistent.]

Change-Id: I6460fbed6bb6bd36eb8554ac8c4fdd574edf3b07
Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
Git-commit: 21a63f65
Git-repo: https://android.googlesource.com/kernel/common.git


Signed-off-by: default avatarKaushal Kumar <kaushalk@codeaurora.org>
Signed-off-by: default avatarBharat Pawar <bpawar@codeaurora.org>
parent 616ee9fa
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment