Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sepolicy
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
public-release-test
platform
system
sepolicy
Commits
3bed75b7
Commit
3bed75b7
authored
8 years ago
by
Nick Kralevich
Committed by
android-build-merger
8 years ago
Browse files
Options
Downloads
Plain Diff
fsck: allow stat access on /dev/block files
am:
585d9767
Change-Id: Ie7c5e03a90dea08abdf351578903299f01c586f3
parents
ac6081e7
585d9767
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
public/domain.te
+1
-1
1 addition, 1 deletion
public/domain.te
public/fsck.te
+10
-3
10 additions, 3 deletions
public/fsck.te
public/fsck_untrusted.te
+11
-0
11 additions, 0 deletions
public/fsck_untrusted.te
with
22 additions
and
4 deletions
public/domain.te
+
1
−
1
View file @
3bed75b7
...
@@ -378,7 +378,7 @@ neverallow {
...
@@ -378,7 +378,7 @@ neverallow {
-system_server
-system_server
-shell # Shell is further restricted in shell.te
-shell # Shell is further restricted in shell.te
-ueventd # Further restricted in ueventd.te
-ueventd # Further restricted in ueventd.te
} frp_block_device:blk_file rw_file_perms;
} frp_block_device:blk_file
no_
rw_file_perms;
# The metadata block device is set aside for device encryption and
# The metadata block device is set aside for device encryption and
# verified boot metadata. It may be reset at will and should not
# verified boot metadata. It may be reset at will and should not
...
...
This diff is collapsed.
Click to expand it.
public/fsck.te
+
10
−
3
View file @
3bed75b7
...
@@ -19,9 +19,16 @@ allow fsck userdata_block_device:blk_file rw_file_perms;
...
@@ -19,9 +19,16 @@ allow fsck userdata_block_device:blk_file rw_file_perms;
allow fsck cache_block_device:blk_file rw_file_perms;
allow fsck cache_block_device:blk_file rw_file_perms;
allow fsck dm_device:blk_file rw_file_perms;
allow fsck dm_device:blk_file rw_file_perms;
# fsck performs a stat() on swap to verify that it is a valid
# To determine if it is safe to run fsck on a filesystem, e2fsck
# swap device before setting the EXT2_MF_SWAP mount flag.
# must first determine if the filesystem is mounted. To do that,
allow fsck swap_block_device:blk_file getattr;
# e2fsck scans through /proc/mounts and collects all the mounted
# block devices. With that information, it runs stat() on each block
# device, comparing the major and minor numbers to the filesystem
# passed in on the command line. If there is a match, then the filesystem
# is currently mounted and running fsck is dangerous.
# Allow stat access to all block devices so that fsck can compare
# major/minor values.
allow fsck dev_type:blk_file getattr;
r_dir_file(fsck, proc)
r_dir_file(fsck, proc)
allow fsck rootfs:dir r_dir_perms;
allow fsck rootfs:dir r_dir_perms;
...
...
This diff is collapsed.
Click to expand it.
public/fsck_untrusted.te
+
11
−
0
View file @
3bed75b7
...
@@ -14,6 +14,17 @@ allow fsck_untrusted vold_device:blk_file rw_file_perms;
...
@@ -14,6 +14,17 @@ allow fsck_untrusted vold_device:blk_file rw_file_perms;
r_dir_file(fsck_untrusted, proc)
r_dir_file(fsck_untrusted, proc)
# To determine if it is safe to run fsck on a filesystem, e2fsck
# must first determine if the filesystem is mounted. To do that,
# e2fsck scans through /proc/mounts and collects all the mounted
# block devices. With that information, it runs stat() on each block
# device, comparing the major and minor numbers to the filesystem
# passed in on the command line. If there is a match, then the filesystem
# is currently mounted and running fsck is dangerous.
# Allow stat access to all block devices so that fsck can compare
# major/minor values.
allow fsck_untrusted dev_type:blk_file getattr;
###
###
### neverallow rules
### neverallow rules
###
###
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment