Commit graph

2708 commits

Author SHA1 Message Date
Treehugger Robot
c5c3f54806 Merge "Adding new GSI public keys" 2020-02-20 06:18:41 +00:00
Bowgo Tsai
b697d47eb3 Adding new GSI public keys
Adding two new public keys for R-Developer-GSI and S-Developer-GSI,
respectively.

Bug: 149805495
Test: m r-developer-gsi.avbpubkey
Test: m s-developer-gsi.avbpubkey
Change-Id: Iaa7521ef40b94f13fe3c9c61d276678f47c60b98
2020-02-19 08:50:26 +00:00
Suren Baghdasaryan
36ef05cbde Merge "Set lowmemorykiller kernel driver parameters before lmkd is started" 2020-02-15 01:02:08 +00:00
Mark Salyzyn
ee016ce0b3 bootstat: enhance last reboot reason property with file backing
Helps with support of recovery and rollback boot reason history, by
also using /metadata/bootstat/persist.sys.boot.reason to file the
reboot reason.

Test: manual
Bug: 129007837
Change-Id: Id1d21c404067414847bef14a0c43f70cafe1a3e2
2020-02-14 13:24:16 -08:00
Suren Baghdasaryan
6898682275 Set lowmemorykiller kernel driver parameters before lmkd is started
When kernel lowmemorykiller driver is enabled lmkd detects it by
checking write access to /sys/module/lowmemorykiller/parameters/minfree
parameter. By default this file does not have write access and init
process changes that from "on boot" section of init.rc. However
"on boot" is never executed in the charger mode, therefore lmkd fails
to detect the kernel driver. Fix this by setting lowmemorykiller kernel
driver parameters before lmkd is started.

Bug: 148572711
Test: boot into charger mode with kernel lmk driver enabled
Change-Id: Ifc3ef725b95bdb5f7d801031429dc26bae014d1f
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2020-02-14 01:40:29 +00:00
Yifan Hong
da8a404473 Merge changes from topic "snapshotctl_log"
* changes:
  libsnapshot callstack files readable by dumpstate
  snapshotctl logs readable by dumpstate
  snapshotctl_log dir readable by dumpstate
2020-02-12 18:18:59 +00:00
Zimuzo Ezeozue
ec9c803503 Merge "Explicitly disable FUSE" 2020-02-11 21:17:53 +00:00
Yifan Hong
7d28688f96 snapshotctl_log dir readable by dumpstate
Set snapshotctl_log as 0755 so that it is
readable by dumpstate.

Test: bugreport
Bug: 148818798
Change-Id: I6ff52cf0a2e928c74df31aa054ae780f919d6eb0
2020-02-11 10:57:51 -08:00
Zim
a3209c5f57 Explicitly disable FUSE
It is already disabled, but having an explcit value in the prop makes
some code in the system_server, easier.

Will follow up with a cl to explicitly enable it on internal master,
aosp will remain this way since it doesn't have the additional
components to run FUSE.

Test: Freshly wiped and flashed device has persist.sys.fuse set to false
Bug: 135341433
Merged-In: I1493e2806823b5751794a9a17ee248dc72b857ff
Change-Id: Ibb955a543e367aa2f4518d5c1c4d070cd084eca0
2020-02-11 16:56:47 +00:00
Jerry Chang
9272319714 Merge "Create directory to store pre-reboot information before reboot" 2020-02-11 02:49:29 +00:00
Treehugger Robot
c17c5b00e1 Merge changes I1bf07301,I48e8ebf3
* changes:
  Remove more duplicated symlinks
  Remove duplicated debugfs symlink
2020-02-10 23:10:08 +00:00
Luca Stefani
57909b4c30 Remove more duplicated symlinks
They're all created in rootdir/Android.mk

Test: m
Change-Id: I1bf07301434d8cf4f2e9226071983d7aeaf149ac
2020-02-10 22:23:29 +01:00
Luca Stefani
8c61e7da49 Remove duplicated debugfs symlink
* Currently it's created at build-time in rootdir/Android.mk

Test: m
Change-Id: I48e8ebf3412dfdfc2dff3b4fcf9b72de52726865
2020-02-10 21:56:03 +01:00
Miao Wang
c3991a7150 Add an stune group for NNAPI HAL
- schedtune.prefer_idle 1
 - schedtune.boost 1

Test: mm
Test: configure NNAPI HAL to use nnapi-hal stune
Test: measure perf difference using MLTS benchmark

Change-Id: I5f467c6a58f2c1da40ec8276e101defc808854a3
(cherry picked from commit 1d748feaec)
2020-02-10 11:47:49 -08:00
Nikita Ioffe
15e4f6fe5a Merge "Don't log userspace_reboot.started/finished properties from init" 2020-02-10 17:22:03 +00:00
Nikita Ioffe
c2bc1a3422 Reset dev.bootcomplete property during userspace reboot
Test: adb reboot userspace
Bug: 135984674
Change-Id: I7c6e433c819fc22e88820626768fe8832882386e
2020-02-07 17:42:27 +00:00
Nikita Ioffe
85ff4ab9a4 Don't log userspace_reboot.started/finished properties from init
Instead they will be logged from system_server. This CL just prepares
grounds for logging CL to land.

Test: adb reboot userspace
Bug: 148767783
Change-Id: Ie9482ef735344ecfb0de8a37785d314a3c0417ff
2020-02-07 14:41:39 +00:00
Jerry Chang
aedac7e625 Create directory to store pre-reboot information before reboot
Bug: 145203410
Test: Built and flashed, checked directory was created
Change-Id: Ic4d43fba62301bde23bec459b5b8b6332be2b6dc
2020-02-06 19:42:42 +08:00
Daniel Rosenberg
02e5e1ea22 Merge "Make /data/media case insensitive" 2020-02-04 23:03:38 +00:00
Yifan Hong
c19b08a66a Merge "Make snapshotctl logging better." 2020-02-04 22:18:33 +00:00
Yifan Hong
12fe03d470 Make snapshotctl logging better.
snapshotctl merge --logcat --log-to-file
- If --logcat, log to logcat
- If --log-to-file, log to /data/misc/snapshotctl_log/
- If both, log to both
- If none, log to stdout

Test: manually test these 4 cases
Bug: 148818798
Change-Id: I44b52936c0d095867acc6ee781c6bec04f6ebd6b
2020-02-04 14:01:24 -08:00
Treehugger Robot
b970633642 Merge "Mount binderfs" 2020-02-04 00:50:10 +00:00
Hridya Valsaraju
b237d76ae5 Mount binderfs
Mount binderfs at /dev/binderfs. Also add symlinks from /dev/binder,
/dev/hwbinder and /dev/vndbinder to /dev/binderfs/binder,
/dev/binderfs/hwbinder and /dev/binderfs/vndbinder respectively.

The symlink commands will fail harmlessly on a kernel
which does not support binderfs since /dev/{binder,hwbinder,vndbinder}
devices will exist on the same.

Bug: 136497735
Bug: 148696163

Test: Cuttlefish boots on Android Common Kernel 4.19 with kernel config
CONFIG_ANDROID_BINDERFS=y.

Change-Id: I8e04340dc4622b0a3c1fc4aa6bbefcb24eefe00b
2020-02-03 22:14:21 +00:00
Treehugger Robot
823beae16a Merge "Revert "Mount binderfs"" 2020-02-03 18:37:40 +00:00
Oli Lan
0460f65f78 Merge "Allow apexd to snapshot and restore DE data." 2020-02-03 17:50:51 +00:00
Oli Lan
a466ca8ff4 Allow apexd to snapshot and restore DE data.
This calls into apexd to allow it to snapshot and restore DE apex data
in the case of a rollback. See the corresponding apexd change for more
information.

Cherry-pick from (unsubmitted) internal CL: ag/10163227

Bug: 141148175
Test: atest StagedRollbackTest#testRollbackApexDataDirectories_DeSys
Change-Id: Ia4bacc9b7b7a77038ba897acbc7db29e177a6433
2020-02-03 11:47:15 +00:00
Zimuzo Ezeozue
294c16024b Merge "Harden /mnt/pass_through paths" 2020-02-03 11:34:52 +00:00
Nikita Ioffe
03aaecbd99 Merge "Don't reset sys.usb.configfs during userspace reboot" 2020-02-03 08:12:38 +00:00
Daniel Rosenberg
ebfe359ca8 Make /data/media case insensitive
Use chattr to apply +F to /data/media
This will fail on devices who do not support casefolding on userdata.

Bug: 138322712
Test: /data/media is set to +F.
Change-Id: Ib341c23a0992ee97b23113b3a72f33a61e583b04
2020-01-31 18:34:03 -08:00
Maciej Żenczykowski
8fda5feb25 Merge "symlink /dev/net/tun -> ../tun" 2020-02-01 01:24:57 +00:00
Greg Kaiser
49a542a979 Revert "Mount binderfs"
This reverts commit 8e50be74ae.

Reason for revert: Several devices did not boot
Test: Local build with this reverted had the device boot
Bug: 148689473
Merged-In: I97e96bd86d02a9fe70c5ef02df85c604b0cfb3c3

Change-Id: Ic4a2990e7c0cb08c374a336422c08d9aad28049d
2020-01-31 23:37:21 +00:00
Treehugger Robot
938379de5b Merge "Mount binderfs" 2020-01-31 18:46:14 +00:00
Zim
a67b40bc2a Harden /mnt/pass_through paths
Only the FUSE daemon (with media_rw gid) needs access to paths on
/mnt/pass_through. And even then, it only needs execute access on the
dirs, since there will always be a bind mount either from sdcardfs or
the lower filesystem on it and that bind mount correctly handles ACLs
for the FUSE daemon.

Test: manual
Bug: 135341433
Change-Id: I999451e095da355e6247e9e18fb6fe1ab8fc45d6
2020-01-31 16:26:13 +00:00
Nikita Ioffe
4f8e05663e Don't reset sys.usb.configfs during userspace reboot
Test: adb reboot userspace (on blueline)
Test: adb reboot userspace (on cuttlefish)
Bug: 147726967
Change-Id: Id4a367e74b418a85e8454e952e12e0723efc9b8a
2020-01-31 15:59:19 +00:00
Maciej Żenczykowski
00a21e3d54 symlink /dev/net/tun -> ../tun
This is the expected location on Linux and this makes 'ip tuntap' work.

Before:
  vsoc_x86_64:/ # ip tuntap add dev tun0 mode tun
  open: No such file or directory
  vsoc_x86_64:/ # ip tuntap add dev tap0 mode tap
  open: No such file or directory
  vsoc_x86_64:/ # ip tuntap list

After:
  vsoc_x86_64:/ # ip tuntap add dev tun0 mode tun
  vsoc_x86_64:/ # ip tuntap add dev tap0 mode tap
  vsoc_x86_64:/ # ip tuntap list
  tap0: tap UNKNOWN_FLAGS:800
  tun0: tun UNKNOWN_FLAGS:800

  $ adbz shell ls -ldZ / /dev /dev/tun /dev/net /dev/net/tun
  drwxr-xr-x 25 root   root u:object_r:rootfs:s0         4096 2020-01-25 09:48 /
  drwxr-xr-x 21 root   root u:object_r:device:s0         1240 2020-01-25 09:48 /dev
  drwxr-xr-x  2 root   root u:object_r:device:s0           60 2020-01-25 09:48 /dev/net
  lrwxrwxrwx  1 root   root u:object_r:device:s0            6 2020-01-25 09:48 /dev/net/tun -> ../tun
  crw-rw----  1 system vpn  u:object_r:tun_device:s0  10, 200 2020-01-25 09:48 /dev/tun

Test: see above
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I2aa215711454ce4f8a0ef1f34c17621629060fa1
2020-01-30 03:51:33 +00:00
Hridya Valsaraju
8e50be74ae Mount binderfs
Mount binderfs at /dev/binderfs. Also add symlinks from /dev/binder,
/dev/hwbinder and /dev/vndbinder to /dev/binderfs/binder,
/dev/binderfs/hwbinder and /dev/binderfs/vndbinder respectively.

Bug: 136497735
Test: Cuttlefish boots on Android Common Kernel 4.19 with kernel config
CONFIG_ANDROID_BINDERFS=y.

Change-Id: I349face22a2e73bfd79af0188e41188c323388f7
2020-01-29 17:59:17 -08:00
Alistair Delva
1fad2b39a3 Merge "Correct /sys/kernel/tracing permissions" 2020-01-30 00:08:02 +00:00
Alistair Delva
ebb5b3bd48 Correct /sys/kernel/tracing permissions
In Android kernels >4.4 we will see an empty /sys/kernel/tracing
directory which is notionally where you should mount tracefs if you
don't want to mount debugfs. As we move towards not mounting debugfs,
ensure that the non-legacy location also has adequate permissions to be
read by tracing tools.

Note that this change will be OK even if the board init.rc doesn't mount
tracefs here, because sysfs will always create this directory.

Bug: 148436518
Change-Id: I674587d0f08effdb8471a82e3b1ceec3af8588de
2020-01-29 09:10:50 -08:00
Nikita Ioffe
2d88794a7d Merge "Trigger boot animation on userspace reboot" 2020-01-29 11:24:01 +00:00
Nikita Ioffe
764c1ac8ba Trigger boot animation on userspace reboot
Also reset some more properties to make bootanimation work properly.

Test: adb reboot userspace
Bug: 148172262
Change-Id: I0154d4fe9377c019150f5b1a709c406925db584d
2020-01-28 10:42:44 +00:00
Zim
c1b53de450 Change gid bit of /mnt/media_rw to external_storage
To allow apps with MANAGE_EXTERNAL_STORAGE permission and therefore
external_storage gid to access unreliable volumes directly on
/mnt/media_rw/<volume>, they need access to the /mnt/media_rw path.

This change doesn't break the FUSE daemon, the only process that should
have media_rw gid in R because the FUSE daemon accesses the lower
filesystem from the pass_through bind mounts of the public volume mount
itself so it doesn't need to walk the /mnt/media_rw path itself

Test: With FUSE enabled, a reliably mounted public volume is accessible
on /storage
Bug: 144914977

Change-Id: Ia3fc9e7483894402c14fb520024e2acca821a24d
2020-01-24 22:13:58 +00:00
Oliver Nguyen
38b33c09f9 Merge "Set Clang coverage environment variables." 2020-01-22 22:34:35 +00:00
Treehugger Robot
eba798a767 Merge "Harden /mnt/pass_through permission bits" 2020-01-22 21:30:53 +00:00
Zim
6ca090e6b0 Harden /mnt/pass_through permission bits
It previously had 0755 permission bits

With such permissive bits, an unauthorized app can access a file using
the /mnt/pass_through path for instance even if access via /storage
would have been restricted.

It is now 0700

TODO: Change ACL for /mnt/user from 0755 to 0700 in vold only when
FUSE flag is on. Changing it with FUSE off breaks accessing /sdcard
because /sdcard is eventually a symlink to /mnt/user/0/primary

Test: adb shell ls -d /mnt/pass_through
Bug: 135341433
Change-Id: I3ea9655c6b8c6b4f847b34a2d3b96784a8f4a160
2020-01-22 17:54:45 +00:00
Ryan Savitski
cdebef1d2b Merge "init: add builtin check for perf_event LSM hooks" 2020-01-21 20:40:50 +00:00
Oli Lan
90c523b30b Give x permission on apex data directories.
This gives search (x) permission on the parent apex data
directory /data/misc/apexdata so that directories below it
may be opened. It also gives that permission on the apex
data directories themselves.

Bug: 147848983
Test: Build & flash, check perms are correct
Change-Id: I27c4ea01602002c89d0771a144265e3879d9041a
2020-01-17 11:41:04 +00:00
David Zeuthen
e83f386653 Add user for credstore.
The credstore system daemon is running as an unprivileged user. This
CL adds this user and also creates a directory (/data/misc/credstore/)
where this daemon can store its data.

Bug: 111446262
Test: N/A
Change-Id: I8da2c32dd04fef797870b8a7bbc5e499bed71f9e
2020-01-16 07:32:04 -05:00
Ryan Savitski
f0f7e70186 init: add builtin check for perf_event LSM hooks
Historically, the syscall was controlled by a system-wide
perf_event_paranoid sysctl, which is not flexible enough to allow only
specific processes to use the syscall. However, SELinux support for the
syscall has been upstreamed recently[1] (and is being backported to
Android R release common kernels).
[1] da97e18458

As the presence of these hooks is not guaranteed on all Android R
platforms (since we support upgrades while keeping an older kernel), we
need to test for the feature dynamically. The LSM hooks themselves have
no way of being detected directly, so we instead test for their effects,
so we perform several syscalls, and look for a specific success/failure
combination, corresponding to the platform's SELinux policy.

If hooks are detected, perf_event_paranoid is set to -1 (unrestricted),
as the SELinux policy is then sufficient to control access.

This is done within init for several reasons:
* CAP_SYS_ADMIN side-steps perf_event_paranoid, so the tests can be done
  if non-root users aren't allowed to use the syscall (the default).
* init is already the setter of the paranoid value (see init.rc), which
  is also a privileged operation.
* the test itself is simple (couple of syscalls), so having a dedicated
  test binary/domain felt excessive.

I decided to go through a new sysprop (set by a builtin test in
second-stage init), and keeping the actuation in init.rc. We can change
it to an immediate write to the paranoid value if a use-case comes up
that requires the decision to be made earlier in the init sequence.

Bug: 137092007
Change-Id: Ib13a31fee896f17a28910d993df57168a83a4b3d
2020-01-15 20:58:15 +00:00
Treehugger Robot
ec7be0dc0f Merge "Create /mnt/data_mirror/cur_profiles in init.rc" 2020-01-15 19:47:52 +00:00
Treehugger Robot
e4505960b9 Merge "Disable dm-verity hash prefetching." 2020-01-15 13:13:01 +00:00