Commit graph

16480 commits

Author SHA1 Message Date
Jeff Vander Stoep
424517721c Remove access to /proc/net/{tcp,udp}
Remove these files from proc_net_type. Domains that need access must
have permission explicitly granted. Neverallow app access except the
shell domain.

Bug: 114475727
Test: atest CtsLibcoreOjTestCases
Test: netstat, lsof
Test: adb bugreport
Change-Id: I2304e3e98c0d637af78a361569466aa2fbe79fa0
2018-09-30 21:33:47 -07:00
Jeff Vander Stoep
649bfacb0d Merge "Remove untrusted app access to /proc/net"
am: c62bdd0ec1

Change-Id: Ibe8598a9513cda0c17ca7ad2702c6575afbe4af7
2018-09-30 21:14:15 -07:00
Treehugger Robot
c62bdd0ec1 Merge "Remove untrusted app access to /proc/net" 2018-10-01 03:58:50 +00:00
Tri Vo
8a64ca3b09 Merge "Don't require private types in mapping file."
am: f505d74410

Change-Id: Icbb0aa076f3ec648eb92e38087a0acf236870838
2018-09-28 21:24:40 -07:00
Treehugger Robot
f505d74410 Merge "Don't require private types in mapping file." 2018-09-29 02:57:20 +00:00
Tri Vo
e3f4f77d39 Don't require private types in mapping file.
Private types are not visible to vendor/odm policy, so we don't need mapping
entries for them.

We build platform-only public policy .cil file and give it as input to
treble_sepolicy_tests. Using this public policy the test can now figure out if
the newly added type in public or private.

Bug: 116344577
Test: adding public type triggers mapping test failure, adding private type does
not.
Change-Id: I421f335e37274b24aa73109e260653d7b73788b5
2018-09-28 17:22:25 -07:00
Sudheer Shanka
2b9560be50 Merge "Allow zygote to mount on sdcardfs dirs."
am: ea44744f94

Change-Id: I6f0bdb02dfad560a65dc332bc9a849dcd431b091
2018-09-28 16:24:51 -07:00
Yifan Hong
0d712fdccc Merge "update_engine: allow to r/w super partition metadata"
am: 289132e355

Change-Id: Id83b7a60491be6882c46b25bbac0fa00a1eba282
2018-09-28 16:19:34 -07:00
Sudheer Shanka
ea44744f94 Merge "Allow zygote to mount on sdcardfs dirs." 2018-09-28 23:19:24 +00:00
Yifan Hong
289132e355 Merge "update_engine: allow to r/w super partition metadata" 2018-09-28 23:03:47 +00:00
Howard Ro
578a189178 Update sepolicies for stats hal
Bug: 116732452
Test: No sepolicy violations observed with this change
(cherry picked from commit I1958182dd8ecc496625da2a2a834f71f5d43e7bb)

Change-Id: Ib386767d8acfacf9fedafd9a79dd555ce233f41c
2018-09-28 13:34:37 -07:00
Sudheer Shanka
4fc64db5c1 Allow zygote to mount on sdcardfs dirs.
Bug: 111890351
Test: manual
Change-Id: I37d632c9877c6d6f929937d8e25098763807630c
2018-09-28 13:28:46 -07:00
Chenbo Feng
cc5329be25 Merge "Block access to xt_qtaguid proc files"
am: 21eed51185

Change-Id: Id6bb84ad2e53935f1bc7f8f7a89dd58916635eb6
2018-09-28 12:16:09 -07:00
Treehugger Robot
21eed51185 Merge "Block access to xt_qtaguid proc files" 2018-09-28 18:35:47 +00:00
Jeff Vander Stoep
d78e07cbb7 Remove untrusted app access to /proc/net
This change is for testing potential app-compat issues when removing
access to file in /proc/net. See: b/114475727#comment11.

Bug: 114475727
Test: build/boot taimen.
Test: atest CtsLibcoreOjTestCases
Test: FileSystemPermissionTest
Test: ListeningPortsTest b/114772424
Change-Id: I1db1c2b41308e47c9ec9db57ea8597a650c8906d
(cherry picked from commit 6784f80bad)
2018-09-28 10:46:19 -07:00
Wei Wang
6da1e5f293 Allow traceur to call atrace HAL
am: da427a33c9

Change-Id: I082f2997b3a0df019cd0902c41f372ef0cd886b3
2018-09-27 19:28:52 -07:00
Chenbo Feng
16dbe82eaf Block access to xt_qtaguid proc files
In the next Android release, there will be devices that have no
xt_qtaguid module at all and framework and netd will decide which code
path it takes for trafficStats depending on the device setup. So all
apps and services should not depend on this device specific
implementation anymore and use public API for the data they need.

Bug: 114475331
Bug: 79938294
Test: QtaguidPermissionTest

Change-Id: I0d37b2df23782eefa2e8977c6cdbf9210db3e0d2
2018-09-28 01:33:02 +00:00
Wei Wang
a15a0804bc Add atrace HAL 1.0 sepolicy
am: bc71a6109e

Change-Id: Iad34b6a0a8e4a9b885244804e07c93bc79f8731b
2018-09-27 16:27:11 -07:00
Wei Wang
da427a33c9 Allow traceur to call atrace HAL
Bug: 116783882
Bug: 111098596
Test: turn on/off system_tracing
Change-Id: I089851924bdb1a5cd71598a7014d17fedc87625a
2018-09-27 23:18:49 +00:00
Wei Wang
bc71a6109e Add atrace HAL 1.0 sepolicy
Bug: 111098596
Test: atrace/systrace

(cherry picked from commit 9ed5cf6e43)

Change-Id: I97772ff21754d03a0aea0d53b39e8da5312a17c0
2018-09-27 23:18:29 +00:00
Yifan Hong
37427dbce1 update_engine: allow to r/w super partition metadata
and (un)map on dev mapper.

Test: resize partitions during OTA
Bug: 110717529

Change-Id: Ia0b66a188232795cf7c649b48af985a583f3471d
2018-09-27 15:39:12 -07:00
Nick Kralevich
dcd05ff6ef Introduce system_file_type
am: 5e37271df8

Change-Id: Ifc1a373f8aacb6b519b71dd23ec05b7c86f15e36
2018-09-27 15:28:16 -07:00
Nick Kralevich
2a63803348 Label /system/usr/share/zoneinfo differently
am: ff1c765ff2

Change-Id: I8765a406f9d075c76235220b68fd7dc79a15d12a
2018-09-27 15:28:03 -07:00
Nick Kralevich
5e37271df8 Introduce system_file_type
system_file_type is a new attribute used to identify files which exist
on the /system partition. It's useful for allow rules in init, which are
based off of a blacklist of writable files. Additionally, it's useful
for constructing neverallow rules to prevent regressions.

Additionally, add commented out tests which enforce that all files on
the /system partition have the system_file_type attribute. These tests
will be uncommented in a future change after all the device-specific
policies are cleaned up.

Test: Device boots and no obvious problems.
Change-Id: Id9bae6625f042594c8eba74ca712abb09702c1e5
2018-09-27 12:52:09 -07:00
Nick Kralevich
ff1c765ff2 Label /system/usr/share/zoneinfo differently
/system/usr/share/zoneinfo is currently labeled zoneinfo_data_file,
a label shared with /data/misc/zoneinfo. However, each of these
directory locations has different security characteristics. In
particular, the files in /system/usr/share/zoneinfo must never be
writable, whereas /data/misc/zoneinfo may be written to by system_server.
Reusing the same label hides these different security characteristics.

Create a separate label for /system/usr/share/zoneinfo.

Test: Device boots and no obvious problems.
Change-Id: I8cf16ff038b06b38f77388e546d9b7a6865f7879
2018-09-27 10:18:40 -07:00
huangyanjun
d13dcc55fb Merge "Fix building error for multi-line dontaudit statement"
am: 0e0feac01b

Change-Id: I80d98118dc0fe1e15ef4c707ad0d10076d905767
2018-09-27 09:43:27 -07:00
Treehugger Robot
0e0feac01b Merge "Fix building error for multi-line dontaudit statement" 2018-09-27 16:29:39 +00:00
Nick Kralevich
43aa650ca3 Merge "gracefully handle hashtab_search failures"
am: 91bde1d771

Change-Id: I2d2b2994435deb609e0c69417b9b55eccffbe7a5
2018-09-26 21:21:23 -07:00
Treehugger Robot
91bde1d771 Merge "gracefully handle hashtab_search failures" 2018-09-27 02:21:11 +00:00
Nick Kralevich
bca68b0d27 system_linker_exec: Remove exec_type
am: dbddbe42d2

Change-Id: I0acdc675e3f2c3038bd73b6c8571099dc612c196
2018-09-26 16:49:33 -07:00
Nick Kralevich
bb880a2826 gracefully handle hashtab_search failures
Otherwise we crash on a null pointer exception.

Test: Reference a non-existent type in test code and make sure
    the test doesn't crash.

Change-Id: I5839d2740d51c0df7a8909a3f8430850ae1b2675
2018-09-26 14:28:44 -07:00
Nick Kralevich
dbddbe42d2 system_linker_exec: Remove exec_type
system/sepolicy/public/attributes defines exec_type as:

  # All types used for domain entry points.
  attribute exec_type;

The linker is not a standalone executable, but rather, used by other
executables to resolve shared libraries. It isn't, and must never be, an
allowed entrypoint for a domain.

Remove the exec_type attribute from system_linker_exec.

Test: Device compiles and boots, no obvious problems running the system.
Change-Id: I8f2f608bc1a642193524396f46b22933faac5468
2018-09-26 12:22:59 -07:00
huangyanjun
250957202f Fix building error for multi-line dontaudit statement
All the *.conf.dontaudit files are generated from *.conf
with the command of 'sed '/dontaudit/d' $@ > $@.dontaudit',
but this command can not be applied to multi-line dontaudit statement.

Test: Set plat_policy.conf.dontaudit as the input_file parameter of
checkpolicy tool, then selinux syntax error will occur during building.

Change-Id: I281de923d8a5f0b46256ec7de4df12a1c1d7e061
2018-09-26 20:42:27 +08:00
Nick Kralevich
7913fb01e8 Android.mk: conditional compilation of odm_sepolicy.cil
am: 1b2ea497aa

Change-Id: I6410593a4f7616958ca8b6cc1ca37401bfc693a6
2018-09-25 13:04:44 -07:00
Nick Kralevich
1b2ea497aa Android.mk: conditional compilation of odm_sepolicy.cil
Do not attempt to build odm_sepolicy.cil if BOARD_ODM_SEPOLICY_DIRS is
not defined. Attempting to do so will create an empty file, which causes
build problems when
0c6ea1e812
is applied.

Test: "cd system/sepolicy && mma -j55" succeeds
Test: "make checkbuild" succeeds
Change-Id: Iefc458bddff3d08e5fcb86f8be3cad16d7e36e73
2018-09-25 11:03:48 -07:00
Tri Vo
e4b212add6 Label /system/bin/linker* symlinks as system_file.
am: 6cd9bd078a

Change-Id: Ifb50348dfec882414d228ef83630c7b4379426e8
2018-09-24 18:33:14 -07:00
Tri Vo
6cd9bd078a Label /system/bin/linker* symlinks as system_file.
Fixes:
avc: denied { read } for comm="init" name="linker_asan64" dev="sda22" ino=1833
scontext=u:r:init:s0 tcontext=u:object_r:system_linker_exec:s0 tclass=lnk_file
permissive=0

Bug: 116486312
Test: adb unroot && adb shell ls -l /system/bin/linker_asan
Change-Id: I754daaf3576e83d516cc9189b8be04dcc41bbc5c
2018-09-24 16:22:38 -07:00
Fan Xu
cf728896d0 Update SELinux Policy for bufferhubd
am: 26fa914cb2

Change-Id: I52b6787ca2ad04f003ec446ce8ac96e375f67c7b
2018-09-24 15:05:57 -07:00
Fan Xu
26fa914cb2 Update SELinux Policy for bufferhubd
Create a new service type buffer_hub_binder_service for
BufferHubBinderService and allow bufferhubd to publish the service.

Add the service to 26.0, 27.0 and 28.0 compat ignore files since the
service is not available in past versions.

Fixes: 116022258
Test: build passed

Change-Id: I5a21f00329ed474433d96c8d1ce32377f20cada3
2018-09-24 12:29:43 -07:00
Oleksiy Avramchenko
3faa2077f2 Merge "Add label for /system/bin/fsck.exfat"
am: 06ddf4b44e

Change-Id: Iedb3581e79540611798a4738bca937af4cbfd5c9
2018-09-24 11:47:33 -07:00
Treehugger Robot
06ddf4b44e Merge "Add label for /system/bin/fsck.exfat" 2018-09-24 18:38:45 +00:00
Tej Singh
44d47c035e Sepolicy for migrating storaged to statsd
This adds /proc/uid_io/stats to the files that system server is able to
read.

Test: Manual test on master produces no selinux violations.
Change-Id: I2c7afec149f893b000094739d91531dec559de6f
2018-09-24 10:42:03 -07:00
Jeff Vander Stoep
90e1c5bfdb Further lock down app data
am: 0b67bb88e5

Change-Id: I84c231dee85060dee61c4c9b7f2187ef35b6ba6a
2018-09-24 09:40:25 -07:00
Oleksiy Avramchenko
65a0b50763 Add label for /system/bin/fsck.exfat
Allow vold to run exFAT filesystem check.

Test: build, mount exFAT volume
Bug: 80202067
Change-Id: I68f3438de89246e806cebe483f37e31c68aaa3d7
2018-09-24 14:04:05 +02:00
Jeff Vander Stoep
0b67bb88e5 Further lock down app data
Assert that only apps and installd may open private app files.

Remove "open" permission for mediaserver/vold and remove their
neverallow exemption.

Test: verify no related audit messages in the logs.
Test: build
Fixes: 80300620
Fixes: 80418809
Bug: 80190017
Change-Id: If0c1862a273af1fedd8898f334c9b0aa6b9be728
2018-09-22 22:38:42 -07:00
Kevin Chyn
e230d6ddc2 Merge "Rename biometric_prompt_service to biometric_service"
am: 7087bf1256

Change-Id: Ideab840443e5086464cb7d93325eaee4af111236
2018-09-21 20:54:16 -07:00
Kevin Chyn
7087bf1256 Merge "Rename biometric_prompt_service to biometric_service" 2018-09-22 03:47:00 +00:00
Tri Vo
70f1c88fa6 Merge "More granular vendor access to /system files."
am: 6816044271

Change-Id: I74d379a088d49e2bb24cd04732dfba8921d3230f
2018-09-21 18:36:55 -07:00
Tri Vo
6816044271 Merge "More granular vendor access to /system files." 2018-09-22 01:30:25 +00:00
Nick Kralevich
259087e59f Merge "version_policy.c: be less verbose at build time"
am: 0d690d34a9

Change-Id: I71ed2f15999870769ad27d90aa6eaef70dde4d4f
2018-09-21 15:00:48 -07:00