Commit graph

9588 commits

Author SHA1 Message Date
Todd Poynor
ca051f6d07 Add /data/misc/reboot and reboot_data_file context
Add a file context for keeping track of last reboot reason and label
directory /data/misc/reboot/ for this purpose.

Bug: 30994946
Test: manual: reboot ocmmand, setprop sys.powerctl, SoC thermal mgr
Change-Id: I9569420626b4029a62448b3f729ecbbeafbc3e66
2017-02-06 15:55:54 -08:00
Stephen Smalley
9376b99362 Remove obsolete netlink_firewall_socket and netlink_ip6fw_socket classes. am: 4921085d9c am: bb268195e2 am: f91ef88342
am: b51dfbb3b2

Change-Id: I90daccc0d9a93985c5b2a090a880ba9e0092445c
2017-02-06 22:42:16 +00:00
Stephen Smalley
64c4f2d0c7 Define extended_socket_class policy capability and socket classes am: 431bdd9f2f am: 7a069af2fc am: eb6196b10f
am: e677bea74e

Change-Id: I48f781c0b9e2192595f44da378ffa24336fabb80
2017-02-06 22:42:13 +00:00
Stephen Smalley
d86b5c8f2b Define the user namespace capability classes and access vectors. am: 8a00360706 am: 60eff1f278 am: 2d6dc8b5e7
am: ffa66ea2e4

Change-Id: I0dd01731c2b005d3750636b36bce5b6aaeee1f5f
2017-02-06 22:42:09 +00:00
Stephen Smalley
b51dfbb3b2 Remove obsolete netlink_firewall_socket and netlink_ip6fw_socket classes. am: 4921085d9c am: bb268195e2
am: f91ef88342

Change-Id: I0b6352a3584188def58b84215383fb0025329518
2017-02-06 22:39:53 +00:00
Stephen Smalley
e677bea74e Define extended_socket_class policy capability and socket classes am: 431bdd9f2f am: 7a069af2fc
am: eb6196b10f

Change-Id: I4ff39ba20966778c4084a91a0454dbc346b08b8c
2017-02-06 22:39:51 +00:00
Stephen Smalley
ffa66ea2e4 Define the user namespace capability classes and access vectors. am: 8a00360706 am: 60eff1f278
am: 2d6dc8b5e7

Change-Id: Id1d56498a1221655543916632c376113da918e14
2017-02-06 22:39:49 +00:00
Stephen Smalley
f91ef88342 Remove obsolete netlink_firewall_socket and netlink_ip6fw_socket classes. am: 4921085d9c
am: bb268195e2

Change-Id: I7f321af50b4d0e5b69c31e2e1d2a5fb9e67ff553
2017-02-06 22:37:54 +00:00
Stephen Smalley
eb6196b10f Define extended_socket_class policy capability and socket classes am: 431bdd9f2f
am: 7a069af2fc

Change-Id: Ic5ba2abe3d5d2aa531ad5aebd64bc564eb707c78
2017-02-06 22:37:51 +00:00
Stephen Smalley
2d6dc8b5e7 Define the user namespace capability classes and access vectors. am: 8a00360706
am: 60eff1f278

Change-Id: I903b56cbf25dcc5e8da3508874afce151571d976
2017-02-06 22:37:49 +00:00
Stephen Smalley
bb268195e2 Remove obsolete netlink_firewall_socket and netlink_ip6fw_socket classes.
am: 4921085d9c

Change-Id: I6bc17893925ad40ad9e9a49c66ff6943ba7a4346
2017-02-06 22:35:51 +00:00
Stephen Smalley
7a069af2fc Define extended_socket_class policy capability and socket classes
am: 431bdd9f2f

Change-Id: Ifb8085ca9b3107acc4c1b658c01b321770c82a96
2017-02-06 22:35:49 +00:00
Stephen Smalley
60eff1f278 Define the user namespace capability classes and access vectors.
am: 8a00360706

Change-Id: Ifdce40a385442a85f69d7e477c95ab540457f54b
2017-02-06 22:35:47 +00:00
Stephen Smalley
4921085d9c Remove obsolete netlink_firewall_socket and netlink_ip6fw_socket classes.
The implementation for NETLINK_FIREWALL and NETLINK_IP6_FW protocols
was removed from the kernel in commit
d16cf20e2f2f13411eece7f7fb72c17d141c4a84 ("netfilter: remove ip_queue
support") circa Linux 3.5.  Unless we need to retain compatibility
for kernels < 3.5, we can drop these classes from the policy altogether.

Possibly the neverallow rule in app.te should be augmented to include
the newer netlink security classes, similar to webview_zygote, but
that can be a separate change.

Test: policy builds

Change-Id: Iab9389eb59c96772e5fa87c71d0afc86fe99bb6b
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2017-02-06 14:24:41 -05:00
Abodunrinwa Toki
ee9dd19119 Merge "Declare new textclassification system service." am: 5470aefbe8 am: 0db7aae1c3 am: 60bfd5d6be
am: 0fb8fe6c58

Change-Id: If5582c95102649dc197402db02d8eaaa5670d99c
2017-02-06 19:12:18 +00:00
Josh Gao
5aa08ed9df Merge changes from topic 'debuggerd_ambient' am: d765766bcb am: d7ebbf1d9b am: 59b687a244
am: ff9596ffcf

Change-Id: I59c221933f992107b2e436e9de14bac56c0928a2
2017-02-06 19:12:06 +00:00
Abodunrinwa Toki
0fb8fe6c58 Merge "Declare new textclassification system service." am: 5470aefbe8 am: 0db7aae1c3
am: 60bfd5d6be

Change-Id: I9451ce42cc1c0dc1f351f48261a80d7c89034e30
2017-02-06 19:10:30 +00:00
Josh Gao
ff9596ffcf Merge changes from topic 'debuggerd_ambient' am: d765766bcb am: d7ebbf1d9b
am: 59b687a244

Change-Id: I6191f42a361b9915a73ad07f5eb2ab78f542bdfa
2017-02-06 19:10:19 +00:00
Josh Gao
e7aeef4544 crash_dump: dontaudit CAP_SYS_PTRACE denial. am: 943d7ed51e am: d04a2dd00e am: c4bc899242
am: f28860e5ee

Change-Id: Ib98c12a50bf1e957f44bece06faf49687acadf49
2017-02-06 19:08:34 +00:00
Josh Gao
be7a43ba3a crash_dump: don't allow CAP_SYS_PTRACE or CAP_KILL. am: 4d140237b5 am: d583a83327 am: 9805f2cde3
am: fc24757a47

Change-Id: I7d720227471de483db81264f0a0a89b430aa4d19
2017-02-06 19:08:30 +00:00
Josh Gao
f28860e5ee crash_dump: dontaudit CAP_SYS_PTRACE denial. am: 943d7ed51e am: d04a2dd00e
am: c4bc899242

Change-Id: I3b18e5ac428349baf2ee5b3cc305fd378c08adca
2017-02-06 19:01:00 +00:00
Josh Gao
fc24757a47 crash_dump: don't allow CAP_SYS_PTRACE or CAP_KILL. am: 4d140237b5 am: d583a83327
am: 9805f2cde3

Change-Id: I09e3c0050b3beaf40df89e153cc2506b8f0b8072
2017-02-06 19:00:57 +00:00
Abodunrinwa Toki
60bfd5d6be Merge "Declare new textclassification system service." am: 5470aefbe8
am: 0db7aae1c3

Change-Id: I191e6bc530fc735167c8d364c552bd2e6e099f9d
2017-02-06 18:57:03 +00:00
Josh Gao
59b687a244 Merge changes from topic 'debuggerd_ambient' am: d765766bcb
am: d7ebbf1d9b

Change-Id: I3f1ec16d480ad653242127f8d2680c4b05461f9f
2017-02-06 18:56:50 +00:00
Abodunrinwa Toki
0db7aae1c3 Merge "Declare new textclassification system service."
am: 5470aefbe8

Change-Id: I9d0adb605c5b38990f77ac21acb16ecc547fe433
2017-02-06 18:55:55 +00:00
Josh Gao
d7ebbf1d9b Merge changes from topic 'debuggerd_ambient'
am: d765766bcb

Change-Id: I94a6e3b6082f9e153a7272c6d75f36f78a8a314c
2017-02-06 18:55:40 +00:00
Josh Gao
c4bc899242 crash_dump: dontaudit CAP_SYS_PTRACE denial. am: 943d7ed51e
am: d04a2dd00e

Change-Id: I911532b7f4b82379005b3f78165ddc1bd4546b21
2017-02-06 18:53:16 +00:00
Josh Gao
9805f2cde3 crash_dump: don't allow CAP_SYS_PTRACE or CAP_KILL. am: 4d140237b5
am: d583a83327

Change-Id: I40a8da8b67dc54552cae42529c9b51cb25da6290
2017-02-06 18:53:12 +00:00
Stephen Smalley
431bdd9f2f Define extended_socket_class policy capability and socket classes
Add a definition for the extended_socket_class policy capability used
to enable the use of separate socket security classes for all network
address families rather than the generic socket class.  The capability
also enables the use of separate security classes for ICMP and SCTP
sockets, which were previously mapped to rawip_socket class.  Add
definitions for the new socket classes and access vectors enabled by
this capability.  Add the new socket classes to the socket_class_set
macro, and exclude them from webview_zygote domain as with other socket
classes.

Allowing access by specific domains to the new socket security
classes is left to future commits.  Domains previously allowed
permissions to the 'socket' class will require permission to the
more specific socket class when running on kernels with this support.

The kernel support will be included upstream in Linux 4.11.  The
relevant kernel commits are da69a5306ab92e07224da54aafee8b1dccf024f6
("selinux: support distinctions among all network address families"),
ef37979a2cfa3905adbf0c2a681ce16c0aaea92d ("selinux: handle ICMPv6
consistently with ICMP"), and b4ba35c75a0671a06b978b6386b54148efddf39f
("selinux: drop unused socket security classes").

This change requires selinux userspace commit
d479baa82d67c9ac56c1a6fa041abfb9168aa4b3 ("libsepol: Define
extended_socket_class policy capability") in order to build the
policy with this capability enabled.  This commit is already in
AOSP master.

Test: policy builds

Change-Id: I788b4be9f0ec0bf2356c0bbef101cd42a1af49bb
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2017-02-06 13:53:11 -05:00
Stephen Smalley
8a00360706 Define the user namespace capability classes and access vectors.
Kernel commit 8e4ff6f228e4722cac74db716e308d1da33d744f
(selinux: distinguish non-init user namespace capability checks)
introduced support for distinguishing capability
checks against a target associated with the init user namespace
versus capability checks against a target associated with a non-init
user namespace by defining and using separate security classes for the
latter.  This support is needed on Linux to support e.g. Chrome usage of
user namespaces for the Chrome sandbox without needing to allow Chrome to
also exercise capabilities on targets in the init user namespace.

Define the new security classes and access vectors for the Android policy.
Refactor the original capability and capability2 access vector definitions
as common declarations to allow reuse by the new cap_userns and cap2_userns
classes.

This change does not allow use of the new classes by any domain; that
is deferred to future changes as needed if/when Android enables user
namespaces and the Android version of Chrome starts using them.

The kernel support went upstream in Linux 4.7.

Based on the corresponding refpolicy patch by Chris PeBenito, but
reworked for the Android policy.

Test: policy builds

Change-Id: I71103d39e93ee0e8c24816fca762944d047c2235
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2017-02-06 13:53:11 -05:00
Abodunrinwa Toki
5470aefbe8 Merge "Declare new textclassification system service." 2017-02-06 18:52:28 +00:00
Josh Gao
d04a2dd00e crash_dump: dontaudit CAP_SYS_PTRACE denial.
am: 943d7ed51e

Change-Id: I4b3e10c0001e61c9ca93f3834342131b1a834a2a
2017-02-06 18:45:35 +00:00
Josh Gao
d583a83327 crash_dump: don't allow CAP_SYS_PTRACE or CAP_KILL.
am: 4d140237b5

Change-Id: I70b3840694763c4eb14a46a931173a343b31926d
2017-02-06 18:45:30 +00:00
Chad Brubaker
13fe6b0c85 Move neverallows from untrusted_app.te to app_neverallows.te am: 46e5a060f6 am: 829c8e0ac0 am: 3d1e5959b4
am: c62facf2f8

Change-Id: Ibe11a940b712c6f4cf0d2f7d92b19f07d63dfe3f
2017-02-06 18:42:15 +00:00
Chad Brubaker
9df342d0a1 Merge ephemeral data and apk files into app am: 4c40d7344c am: 95804f17e7 am: 812213ae66
am: 0100293716

Change-Id: I1148f7c40e25b13c833ece35644c51943f311062
2017-02-06 18:42:13 +00:00
Chad Brubaker
c62facf2f8 Move neverallows from untrusted_app.te to app_neverallows.te am: 46e5a060f6 am: 829c8e0ac0
am: 3d1e5959b4

Change-Id: Iea59fcc55ea2813d71141558e3f86fbfdc22d034
2017-02-06 18:40:13 +00:00
Chad Brubaker
0100293716 Merge ephemeral data and apk files into app am: 4c40d7344c am: 95804f17e7
am: 812213ae66

Change-Id: I38671a9200d7b76dc7b748848f8134df6e2ef267
2017-02-06 18:40:11 +00:00
Chad Brubaker
3d1e5959b4 Move neverallows from untrusted_app.te to app_neverallows.te am: 46e5a060f6
am: 829c8e0ac0

Change-Id: I9ded883761ec9d6fbbcfead877788edbbcb41521
2017-02-06 18:38:13 +00:00
Chad Brubaker
812213ae66 Merge ephemeral data and apk files into app am: 4c40d7344c
am: 95804f17e7

Change-Id: I744c77d2e32dd2d84a64197fb2bf5c41cffa6a61
2017-02-06 18:38:11 +00:00
Josh Gao
d765766bcb Merge changes from topic 'debuggerd_ambient'
* changes:
  crash_dump: dontaudit CAP_SYS_PTRACE denial.
  crash_dump: don't allow CAP_SYS_PTRACE or CAP_KILL.
2017-02-06 18:37:55 +00:00
Chad Brubaker
829c8e0ac0 Move neverallows from untrusted_app.te to app_neverallows.te
am: 46e5a060f6

Change-Id: Id2ccc41a74a8465e6fc33429c13ca22253a53f12
2017-02-06 18:35:12 +00:00
Chad Brubaker
95804f17e7 Merge ephemeral data and apk files into app
am: 4c40d7344c

Change-Id: I680e736766d371f6ac631cae26d11d85dc896e8f
2017-02-06 18:35:10 +00:00
Chad Brubaker
46e5a060f6 Move neverallows from untrusted_app.te to app_neverallows.te
The neverallows in untrusted_app will all apply equally to ephemeral app
and any other untrusted app domains we may add, so this moves them to a
dedicated separate file.

This also removes the duplicate rules from isolated_app.te and ensures
that all the untrusted_app neverallows also apply to isolated_app.

Test: builds
Change-Id: Ib38e136216ccbe5c94daab732b7ee6acfad25d0b
2017-02-06 10:16:50 -08:00
Chad Brubaker
4c40d7344c Merge ephemeral data and apk files into app
The rules for the two types were the same and /data/app-ephemeral is
being removed. Remove these types.

Test: Builds
Change-Id: I520c026395551ad1362dd2ced53c601d9e6f9b28
2017-02-06 10:16:50 -08:00
Abodunrinwa Toki
387367df19 Declare new textclassification system service.
Bug: 34781862
Test: none
Change-Id: Ie628dca592a68ed67a68dda2f3d3e0516e995c80
2017-02-04 04:11:51 +00:00
Max Bires
6722338710 Merge "Exclude dev/null from auditing - was producing log spam." am: a38067c770 am: 0979abc0f9 am: 4aa99076bb
am: 705fdfe8ea

Change-Id: Iacf65cef710aafe9e083ae25b4587ae5e97c5369
2017-02-03 23:15:54 +00:00
Max Bires
705fdfe8ea Merge "Exclude dev/null from auditing - was producing log spam." am: a38067c770 am: 0979abc0f9
am: 4aa99076bb

Change-Id: Ic0fc7bf2a6508bc2db0ee9bf4cee02c57c0f2636
2017-02-03 23:13:24 +00:00
Max Bires
4aa99076bb Merge "Exclude dev/null from auditing - was producing log spam." am: a38067c770
am: 0979abc0f9

Change-Id: I191354b6b80d23fd7fd5ac8e1bff77552278bb95
2017-02-03 23:10:54 +00:00
Max Bires
0979abc0f9 Merge "Exclude dev/null from auditing - was producing log spam."
am: a38067c770

Change-Id: Ia91ea8fec8f28cdb661a55e64ae1d50b03e17363
2017-02-03 23:08:24 +00:00
Treehugger Robot
a38067c770 Merge "Exclude dev/null from auditing - was producing log spam." 2017-02-03 23:04:55 +00:00