Skip to content
Snippets Groups Projects
Commit 74ddf301 authored by Nick Kralevich's avatar Nick Kralevich
Browse files

neverallow mounton lnk_file fifo_file sock_file

Add a compile time assertion that no SELinux rule exists which
allows mounting on top of symbolic links, fifo files, or socket
files. Remove the capability from unconfined domains.

Change-Id: I6d7cc95cd17e2e5f165fa5948563800ed206bb71
parent 68a8f780
No related branches found
No related tags found
No related merge requests found
...@@ -362,3 +362,7 @@ neverallow { ...@@ -362,3 +362,7 @@ neverallow {
# that over time, the kernel global tables used to implement SysV IPCs will fill # that over time, the kernel global tables used to implement SysV IPCs will fill
# up. # up.
neverallow domain domain:{ shm sem msg msgq } *; neverallow domain domain:{ shm sem msg msgq } *;
# Do not mount on top of symlinks, fifos, or sockets.
# Feature parity with Chromium LSM.
neverallow domain { file_type fs_type dev_type }:{ lnk_file fifo_file sock_file } mounton;
...@@ -43,8 +43,8 @@ allow unconfineddomain domain:{ ...@@ -43,8 +43,8 @@ allow unconfineddomain domain:{
tun_socket tun_socket
} *; } *;
allow unconfineddomain domain:key *; allow unconfineddomain domain:key *;
allow unconfineddomain {fs_type -contextmount_type -sdcard_type}:{ dir lnk_file sock_file fifo_file } ~relabelto; allow unconfineddomain {fs_type -contextmount_type -sdcard_type}:{ dir lnk_file sock_file fifo_file } ~{ relabelto mounton };
allow unconfineddomain dev_type:{ dir lnk_file sock_file fifo_file } ~relabelto; allow unconfineddomain dev_type:{ dir lnk_file sock_file fifo_file } ~{ relabelto mounton };
allow unconfineddomain { allow unconfineddomain {
file_type file_type
-keystore_data_file -keystore_data_file
...@@ -55,7 +55,7 @@ allow unconfineddomain { ...@@ -55,7 +55,7 @@ allow unconfineddomain {
-shell_data_file -shell_data_file
-app_data_file -app_data_file
-unlabeled -unlabeled
}:{ dir lnk_file sock_file fifo_file } ~relabelto; }:{ dir lnk_file sock_file fifo_file } ~{ relabelto mounton };
allow unconfineddomain exec_type:dir r_dir_perms; allow unconfineddomain exec_type:dir r_dir_perms;
allow unconfineddomain exec_type:file { r_file_perms execute }; allow unconfineddomain exec_type:file { r_file_perms execute };
allow unconfineddomain exec_type:lnk_file r_file_perms; allow unconfineddomain exec_type:lnk_file r_file_perms;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment