Commit graph

6501 commits

Author SHA1 Message Date
Treehugger Robot
0941c2022d Merge "Add policy for IKeystoreAuthorization AIDL service." 2021-01-15 19:53:16 +00:00
Hunter Knepshield
bbeebab00d Merge "SEPolicy changes for public BugreportManager API." 2021-01-15 19:12:45 +00:00
Hasini Gunasinghe
1a5c2f4ced Add policy for IKeystoreAuthorization AIDL service.
The interaface now provided by IKeystoreAuthorization AIDL interface was
previously provided by Keystore AIDL interface.

This CL adds policy to allow Keystore2 to register
IKeystoreAuthorization aidl service and to allow service manager to
look up and connect to the service.

Bug: 159475191
Test: Needs to be tested in runtime
Change-Id: I56829a8764e0efe55efdc92b75d7a3d918a20dae
2021-01-15 09:43:22 -08:00
Thiébaud Weksteen
d370bc632b Ignore crash_dump access to symlink on /data
Bug: 177643306
Test: build policy
Change-Id: I36744cee0b85f3d6812b142c5bcff95aa0c036bc
2021-01-15 13:18:48 +01:00
Shashwat Razdan
fbe18136fe Merge "Changes in SELinux Policy for smartspace API" 2021-01-15 01:13:32 +00:00
Shashwat Razdan
c97620be76 Changes in SELinux Policy for smartspace API
Bug: 176851064
Test: manual verification ($ adb shell service list)
Change-Id: I2bfa765a7b04f46b22836d295613e629348afbc6
2021-01-14 20:54:03 +00:00
Hunter Knepshield
18312f49b8 SEPolicy changes for public BugreportManager API.
Allow non-system apps to get an instance through
Context#getSystemService, and then dumpstate also needs permissions to
append to public apps' files.

Most carrier apps are not pre-installed, but we still want to allow them
to request connectivity bug reports, which are well-scoped to contain
limited PII and all info should directly relate to connectivity
(cellular/wifi/networking) debugging.

BugreportManager underneath validates that the calling app has carrier
privileges before actually starting the bug report routine. User consent
is requested for every bugreport requested by carrier apps.

Without the dumpstate.te change, the following error will occur:
01-14 20:08:52.394  1755  1755 I auditd  : type=1400 audit(0.0:10): avc: denied { append } for comm="Binder:1755_16" path="/data/user/0/com.carrier.bugreportapp.public/files/bugreports/bugreport-2021-01-14-20-08-51.zip" dev="dm-8" ino=25218 scontext=u:r:dumpstate:s0 tcontext=u:object_r:app_data_file:s0:c7,c257,c512,c768 tclass=file permissive=0
[ 1167.128552] type=1400 audit(1610654932.394:10): avc: denied { append } for comm="Binder:1755_16" path="/data/user/0/com.carrier.bugreportapp.public/files/bugreports/bugreport-2021-01-14-20-08-51.zip" dev="dm-8" ino=25218 scontext=u:r:dumpstate:s0 tcontext=u:object_r:app_data_file:s0:c7,c257,c512,c768 tclass=file permissive=0

Bug: 161393541
Test: atest CtsCarrierApiTestCases:BugreportManagerTest
Change-Id: I443b1f6cd96223ed600c4006bc344c2a8663fdc7
2021-01-14 20:15:34 +00:00
Inseob Kim
150355b1c3 Merge "Revert^2 "Make default_prop only readable from coredomain"" 2021-01-14 09:42:25 +00:00
Inseob Kim
5c011e57a5 Revert^2 "Make default_prop only readable from coredomain"
This reverts commit 32fbfbc016.

Reason for revert: Fixed breakages

Change-Id: I474ee7dd7b82b4f2e02353e8a3fb55e3c410941f
2021-01-14 04:08:16 +00:00
Mitch Phillips
e0bab54ba6 Merge "[MTE] Add memtag sysprop sepolicy." 2021-01-13 18:07:36 +00:00
Hridya Valsaraju
7d457661cc Merge "Allow codec2 to allocate from system-secure heap" 2021-01-13 16:23:52 +00:00
Treehugger Robot
b8e865e1ee Merge "sepolicy: allow init to mount debugfs in userdebug builds" 2021-01-13 04:24:22 +00:00
Hridya Valsaraju
c68de664f9 Allow codec2 to allocate from system-secure heap
Codec2 clients should have the permission to allocate from the
system-secure DMA-BUF heap for secure playback.

avc: denied { ioctl } for path="/dev/dma_heap/system-secure" dev="tmpfs" ino=649
ioctlcmd=0x4800 scontext=u:r:mediaswcodec:s0
tcontext=u:object_r:dmabuf_system_secure_heap_device:s0 tclass=chr_file
permissive=1
avc: denied { read } for comm=4E444B204D65646961436F6465635F
name="system-secure" dev="tmpfs" ino=649 scontext=u:r:system_server:s0
tcontext=u:object_r:dmabuf_system_secure_heap_device:s0 tclass=chr_file
permissive=1
 avc: denied { open } for comm=4E444B204D65646961436F6465635F
path="/dev/dma_heap/system-secure" dev="tmpfs" ino=649
scontext=u:r:system_server:s0
tcontext=u:object_r:dmabuf_system_secure_heap_device:s0 tclass=chr_file
permissive=1
 avc: denied { ioctl } for comm=4E444B204D65646961436F6465635F
path="/dev/dma_heap/system-secure" dev="tmpfs" ino=649 ioctlcmd=0x4800
scontext=u:r:system_server:s0
tcontext=u:object_r:dmabuf_system_secure_heap_device:s0 tclass=chr_file
permissive=1
avc: denied { read } for name="system-secure" dev="tmpfs" ino=649
scontext=u:r:mediaswcodec:s0
tcontext=u:object_r:dmabuf_system_secure_heap_device:s0 tclass=chr_file
permissive=1
avc: denied { open } for path="/dev/dma_heap/system-secure"
dev="tmpfs" ino=649 scontext=u:r:mediaswcodec:s0
tcontext=u:object_r:dmabuf_system_secure_heap_device:s0 tclass=chr_file
permissive=1
avc: denied { read } for
comm=4E444B204D65646961436F6465635F name="system-secure" dev="tmpfs" ino=649
scontext=u:r:platform_app:s0:c512,c768
tcontext=u:object_r:dmabuf_system_secure_heap_device:s0 tclass=chr_file
permissive=1 app=com.android.systemui 0:145):
 avc: denied { open } for
comm=4E444B204D65646961436F6465635F path="/dev/dma_heap/system-secure"
dev="tmpfs" ino=649 scontext=u:r:platform_app:s0:c512,c768
tcontext=u:object_r:dmabuf_system_secure_heap_device:s0 tclass=chr_file
permissive=1
avc: denied { ioctl } for
comm=4E444B204D65646961436F6465635F path="/dev/dma_heap/system-secure"
dev="tmpfs" ino=649 ioctlcmd=0x4800 scontext=u:r:platform_app:s0:c512,c768
tcontext=u:object_r:dmabuf_system_secure_heap_device:s0 tclass=chr_file
permissive=1

Bug: 172527615
Test: manual
Change-Id: I465e5fcd660bb548e93d683e9d20cace7421ed2d
2021-01-12 12:45:01 -08:00
Marco Ballesio
a0a35e0dc2 Merge "sepolicy: allow system_server to read /proc/locks" 2021-01-12 20:22:04 +00:00
David Anderson
9c2b5ef747 Merge "Add a kernel transition to snapuserd." 2021-01-12 19:01:01 +00:00
Marco Ballesio
3eabc1d541 sepolicy: allow system_server to read /proc/locks
Access to /proc/locks is necessary to activity manager to determine
wheter a process holds a lock or not prior freezing it.

Test: verified access of /proc/locks while testing other CLs in the same
topic.
Bug: 176928302

Change-Id: I14a65da126ff26c6528edae137d3ee85d3611509
2021-01-12 10:47:58 -08:00
Tomasz Wasilczyk
c848de1480 Merge "Revert "Revert "hal_can_*: use hal_attribute_service""" 2021-01-12 16:45:24 +00:00
Joanne Chung
8327dc1fb1 Merge "Add rule for new system service" 2021-01-12 11:54:53 +00:00
Florian Mayer
685c74b6b6 Merge "Allow heapprofd central mode on user builds." 2021-01-12 11:40:19 +00:00
Alan Stokes
f4ba047517 Merge "Make shared_relro policy private." 2021-01-12 11:19:54 +00:00
Joanne Chung
993aeab1c7 Add rule for new system service
- Update policy for new system service, used for AiAi/Apps to
  present data in their UI.

Bug: 173243538
Bug: 176208267
Test: manual. Can boot to home and get manager successfully.
Change-Id: Ie88c6fa7ed80c0d695daaa7a9c92e11ce0fed229
2021-01-12 18:00:17 +08:00
ChengYou Ho
f4f75d088a Add sepolicy for authsecret AIDL HAL
Bug: 176107318
Change-Id: I49bc68fb5a92bcbc2f1d2c78f0741f8eff97fc06
2021-01-12 06:01:22 +00:00
Tomasz Wasilczyk
d99750d79e Revert "Revert "hal_can_*: use hal_attribute_service""
This reverts commit 061b56b497.

Reason for revert: second submission attempt

Change-Id: I632968c7c0c369ecc07ec829f59b629c39fb71e9
2021-01-11 18:25:51 +00:00
Florian Mayer
a8a3d8b1bf Allow heapprofd central mode on user builds.
This simplifies operation by removing a special case for user builds.

Test: atest CtsPerfettoTestCases on user
Test: atest CtsPerfettoTestCases on userdebug
Test: atest perfetto_integrationtests on userdebug
Bug: 153139002
Change-Id: Ibbf3dd5e4f75c2a02d931f73b96fabb8157e0ebf
2021-01-11 17:19:02 +00:00
Mitch Phillips
eaf1404d8a [MTE] Add memtag sysprop sepolicy.
These flags should be writeable to the shell for both root and non-root
users. They should be readable everywhere, as they're read in libc
during initialization (and there's nothing secret to hide). We just
don't want to allow apps to set these properties.

These properties are non-persistent, are for local developer debugging
only.

Bug: 135772972
Bug: 172365548
Test: `adb shell setprop memtag.123 0` in non-root shell succeeds.
Change-Id: If9ad7123829b0be27c29050f10081d2aecdef670
2021-01-11 08:35:58 -08:00
ChengYou Ho
553afe7242 Add sepolicy for oemlock aidl HAL
Bug: 176107318
Change-Id: I26f8926401b15136f0aca79b3d5964ab3b59fbdd
2021-01-11 05:57:17 +00:00
Gavin Corkery
b46e956d97 Merge "Add sepolicy for /metadata/watchdog" 2021-01-08 08:20:45 +00:00
Hridya Valsaraju
90eadaac59 sepolicy: allow init to mount debugfs in userdebug builds
This change will help debug builds with keeping debugfs
disabled during run time. Instead, debugfs will be mounted by init
to enable boot time initializations to set up debug data collection
and unmounted after boot. It will be also be mounted by dumpstate
for bug report generation and unmounted after.

It resolves the following avc denial:
avc: denied { mounton } for comm="init" path="/sys/kernel/debug" dev="debugfs"
 ino=1 scontext=u:r:init:s0 tcontext=u:object_r:debugfs:s0 tclass=dir permissive=0

Bug: 176936478
Test: make && boot
Change-Id: I5bc819eb0cc36bdc32565c17a16da8838baf946a
2021-01-07 21:32:24 -08:00
Gavin Corkery
b0aae28b41 Add sepolicy for /metadata/watchdog
See go/rescue-party-reboot for more context.

One integer will be stored in a file in this
directory, which will be read and then deleted at the
next boot. No userdata is stored.

Test: Write and read from file from PackageWatchdog
Bug: 171951174

Change-Id: I18f59bd9ad324a0513b1184b2f4fe78c592640db
2021-01-07 19:42:56 +00:00
Jaegeuk Kim
dc16f6d896 Allow vold to run make_f2fs
type=1400 audit(1901536.380:4): avc: denied { ioctl } for comm="make_f2fs" path="/dev/block/dm-9" dev="tmpfs" ino=30744 ioctlcmd=0x1277 scontext=u:r:vold:s0 tcontext=u:object_r:dm_device:s0 tclass=blk_file permissive=0

Bug: 172378121
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: Iff0ae7a8ff3dd1d4fa3fd29a4db218eaac9ba253
2021-01-05 18:06:18 -08:00
Steven Moreland
4008d6242d Merge "hal_audiocontrol: use hal_attribute_service" 2021-01-05 18:12:56 +00:00
Alan Stokes
5b73b80b0d Make shared_relro policy private.
Nothing should be depending on the details.

I haven't removed public/shared_relro.te entirely - there's a reference to shared_relro in public/app.te, and at least one reference to the domain outside of system policy.

Fix: 175867372
Test: Presubmits
Change-Id: I5fd4090f4b445520c4fa767c1835a5bb4e9cb146
2021-01-05 09:48:10 +00:00
Inseob Kim
726dc022db Merge "Revert "Make default_prop only readable from coredomain"" 2021-01-05 08:56:07 +00:00
Jackal Guo
32fbfbc016 Revert "Make default_prop only readable from coredomain"
This reverts commit 082ced1951.

Reason for revert: b/176784961

Change-Id: Ia85667216d63084e9e23aefe1d3bfd7942d51a2a
2021-01-05 08:47:57 +00:00
Treehugger Robot
3acee7da98 Merge "Make default_prop only readable from coredomain" 2021-01-05 05:25:14 +00:00
Nazanin Bakhshi
51872d888d Merge "Revert "hal_can_*: use hal_attribute_service"" 2020-12-29 22:57:03 +00:00
Nazanin Bakhshi
061b56b497 Revert "hal_can_*: use hal_attribute_service"
This reverts commit c8e937efe5.

Reason for revert: <DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?build-cop=true, bug 176180039>

Change-Id: I0aff6ebba8b6a7a45af7229a0506f0426a8ebadf
2020-12-29 22:53:29 +00:00
Peiyong Lin
30b809bd97 Merge "Add SEPolicy rules for game service." 2020-12-29 22:18:24 +00:00
Steven Moreland
8e5c457f2e Merge "hal_can_*: use hal_attribute_service" 2020-12-29 20:43:20 +00:00
Chiachang Wang
bd15e9ac63 Merge "Add new selinux type for radio process" 2020-12-29 00:24:12 +00:00
Peiyong Lin
9449176122 Add SEPolicy rules for game service.
Bug: b/174956354
Test: manual
Change-Id: Ife1aac3435427f89f5701e4ead0763839f01d61b
2020-12-24 18:46:25 -08:00
Chiachang Wang
813c25fc91 Add new selinux type for radio process
ConnectivityService is going to become mainline and can not
access hidden APIs. Telephony and Settings were both accessing
the hidden API ConnectivityManager#getMobileProvisioningUrl.
Moving #getMobileProvisioningUrl method into telephony means
that there is one less access to a hidden API within the overall
framework since the Connectivity stack never needed this value.
Thus, move getMobileProvisioningUrl parsing to telephony surface
and provide the corresponding sepolicy permission for its access.

The exsting radio_data_file is an app data type and may allow
more permission than necessary. Thus create a new type and give
the necessary read access only.

Bug: 175177794
Test: verify that the radio process could read
      /data/misc/radio/provisioning_urls.xml successfully
Change-Id: I191261a57667dc7936c22786d75da971f94710ef
2020-12-24 15:11:15 +08:00
Steven Moreland
7042d472a7 Merge "hal_power_stats: use hal_attribute_service" 2020-12-23 20:18:03 +00:00
Treehugger Robot
9afb3747fe Merge "sepolicy: set expandattribute false for dmabuf_heap_device_type" 2020-12-23 09:16:42 +00:00
Hridya Valsaraju
eab2858649 sepolicy: set expandattribute false for dmabuf_heap_device_type
This is needed to avoid build failure in target bertha_arm64.

Test: make
Bug: 176124106
Change-Id: Id24eaa00dc5d601deb7533ac1d484a76535c8df0
2020-12-23 05:14:31 +00:00
Steven Moreland
bc2624a041 hal_power_stats: use hal_attribute_service
This macro creates the necessary neverallow to assert the
hal_power_stats_{client,server} attribute has exclusive ownership of
the service.

Bug: 176180039
Test: build/TH
Change-Id: I710eadc4c4f4642937aa16a25fe559e1cd3c9224
2020-12-23 01:38:03 +00:00
Steven Moreland
c8e937efe5 hal_can_*: use hal_attribute_service
This macro creates the necessary neverallow to assert the
hal_can_*_{client,server} attribute has exclusive ownership of
the service.

Bug: 176180039
Test: build/TH
Change-Id: I876b50e4184ef787117d5ca67c7fbd522d82687c
2020-12-23 01:36:02 +00:00
Steven Moreland
42a02d77ed hal_audiocontrol: use hal_attribute_service
This macro creates the necessary neverallow to assert the
hal_audiocontrol_{client,server} attribute has exclusive ownership of
the service.

Bug: 176180039
Test: build/TH
Change-Id: I2046e31f5cf04b560b842a03eafbec597443f15f
2020-12-23 01:26:58 +00:00
Kalesh Singh
24ada7dbee Reland: Memtrack HAL stable aidl sepolicy
Bug: 175021432
Test: Check logcat for denials
Change-Id: Id92fc543791072d8682e3a89cbf08370007108bf
2020-12-22 16:08:53 -05:00
Treehugger Robot
831fddd794 Merge "Allow coredomain access to only approved categories of vendor heaps" 2020-12-21 20:34:06 +00:00