Skip to content

Commit 2741936

Browse files
Gabriele MMichael Bestas
Gabriele M
authored and
Michael Bestas
committed
sepolicy: Allow recovery to alter /
This is needed for /etc/fstab, /adb_keys and volmgr Change-Id: I53332a57ce7879d7ba63c4ea3e27add01f5a3a90
1 parent c032133 commit 2741936

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

prebuilts/api/30.0/public/domain.te

+2-2
Original file line numberDiff line numberDiff line change
@@ -490,8 +490,8 @@ neverallow { domain -kernel with_asan(`-asan_extract') } { system_file_type vend
490490
neverallow * exec_type:dir_file_class_set mounton;
491491
neverallow { domain -init } { system_file_type vendor_file_type }:dir_file_class_set mounton;
492492

493-
# Nothing should be writing to files in the rootfs.
494-
neverallow * rootfs:file { create write setattr relabelto append unlink link rename };
493+
# Nothing should be writing to files in the rootfs, except recovery.
494+
neverallow { domain -recovery } rootfs:file { create write setattr relabelto append unlink link rename };
495495

496496
# Restrict context mounts to specific types marked with
497497
# the contextmount_type attribute.

public/domain.te

+2-2
Original file line numberDiff line numberDiff line change
@@ -490,8 +490,8 @@ neverallow { domain -kernel with_asan(`-asan_extract') } { system_file_type vend
490490
neverallow * exec_type:dir_file_class_set mounton;
491491
neverallow { domain -init } { system_file_type vendor_file_type }:dir_file_class_set mounton;
492492

493-
# Nothing should be writing to files in the rootfs.
494-
neverallow * rootfs:file { create write setattr relabelto append unlink link rename };
493+
# Nothing should be writing to files in the rootfs, except recovery.
494+
neverallow { domain -recovery } rootfs:file { create write setattr relabelto append unlink link rename };
495495

496496
# Restrict context mounts to specific types marked with
497497
# the contextmount_type attribute.

0 commit comments

Comments
 (0)