Commit graph

49757 commits

Author SHA1 Message Date
Nick Kralevich
ac3ca99b77 introduce auditctl and use it to configure SELinux throttling
In an effort to ensure that our development community does not
introduce new code without corresponding SELinux changes, Android
closely monitors the number of SELinux denials which occur during
boot. This monitoring occurs both in treehugger, as well as various
dashboards. If SELinux denials are dropped during early boot, this
could result in non-determinism for the various SELinux treehugger
tests.

Introduce /system/bin/auditctl. This tool, model after
https://linux.die.net/man/8/auditctl , allows for configuring the
throttling rate for the kernel auditing system.

Remove any throttling from early boot. This will hopefully reduce
treehugger flakiness by making denial generation more predictible
during early boot.

Reapply the throttling at boot complete, to avoid denial of service
attacks against the auditing subsystem.

Delete pre-existing unittests for logd / SELinux integration. It's
intended that all throttling decisions be made in the kernel, and
shouldn't be a concern of logd.

Bug: 118815957
Test: Perform an operation which generates lots of SELinux denials,
      and count how many occur before and after the time period.

(cherry picked from commit be5e446791)

Change-Id: I283cd56151d199cd66f0d217b49115460c4a01e5
2019-04-09 20:54:47 -07:00
TreeHugger Robot
83e52ce905 Merge "charger: Allow to rw /sys/power/[state,wakeup_count]" into qt-dev 2019-04-10 01:33:58 +00:00
Christopher Ferris
98877cbabe Remove include of backtrace/Backtrace.h.
Somehow the code was still including this include from libbacktrace.
I think the libbacktrace include directory was coming from some
transitive includes. I verified that nothing in debuggerd is using
the libbacktace.so shared library.

Bug: 120606663

Test: Builds, unit tests pass.
Change-Id: I85c2837c5a539ccefc5a7140949988058d21697a
Merged-In: I85c2837c5a539ccefc5a7140949988058d21697a
(cherry picked from commit 3336c7bce0)
2019-04-09 13:22:51 -07:00
Yifan Hong
c9a9d279ef charger: Allow to rw /sys/power/[state,wakeup_count]
charger needs to suspend the device when the power goes away
when it doesn't have root. These two files are marked with
group system, user system, mode 0600 in 'on boot', but
it is not executed in charger. Hence, move these actions
to 'on init'.

Test: no failure in libsuspend in charger

Bug: 129138950

Change-Id: I787b935b4ff6177601329aeedccdac361b119ca3
2019-04-09 13:13:33 -07:00
TreeHugger Robot
b017a1cd9b Merge "Test is-logical command for vendor and boot partitions." into qt-dev 2019-04-09 05:11:19 +00:00
Hridya Valsaraju
1e30c33a1a Test is-logical command for vendor and boot partitions.
Vendor must be a logical partition and boot must not be a logical
partition.

Test: fuzzy_fastboot --gtest_filter=*Logical*
Bug: 117220134
Change-Id: Ifc6f2f715ca92cd1fe779e8fce2d6a10a1f140b9
Merged-In: Ifc6f2f715ca92cd1fe779e8fce2d6a10a1f140b9
(cherry picked from commit 61a5bc6cf4)
2019-04-08 15:31:25 -07:00
Bowgo Tsai
13d92df720 Update GSI keys for dynamic system image
Bug: 112293933
Test: tree hugger
Change-Id: Ia5fd08410fd680b8fd3676cfc4daae1caf1ff425
Merged-In: Ia5fd08410fd680b8fd3676cfc4daae1caf1ff425
(cherry picked from commit b9b9a68f49)
2019-04-08 23:59:26 +08:00
TreeHugger Robot
723c4df590 Merge "cutils: add ashmem_init" into qt-dev 2019-04-05 17:06:51 +00:00
TreeHugger Robot
c202a4f883 Merge "Allow to build non-sparse super image." into qt-dev 2019-04-05 10:17:16 +00:00
TreeHugger Robot
bd0f767dfe Merge "CgroupSetupCgroups: don't leak fd." into qt-dev 2019-04-05 04:45:42 +00:00
TreeHugger Robot
0294313ad9 Merge "Open image files in binary mode" into qt-dev 2019-04-05 02:42:47 +00:00
Tim Murray
943f1c1d4a cutils: add ashmem_init
Add a new ashmem_init function that only dlopens libashmemd_client.
This allows the library to be preloaded in the zygote.

Test: boots, works
Bug: 129543489

Change-Id: Ie106791edf381654f085203c266c9f9c0df35cfc
2019-04-05 00:28:05 +00:00
Yifan Hong
b4b2bfc115 Allow to build non-sparse super image.
- Rename SparseBuilder to ImageBuilder, WriteSplitSparseFiles
  to WriteSplitImageFiles, WriteToSparseFile to WriteToImageFile, etc.
- Add sparsify argument to ImageBuilder, WriteToImageFile, and
  WriteSplitImageFiles

This allows lpmake to write non-sparse super image directly. Virtual
devices needs non-sparse images to work on.

Test: lpmake without --sparse
Test: liblp_test
Bug: 120041578

Change-Id: I76ee09efd02df7caaa8abd37a55ae0bebf9cfa29
Merged-In: I76ee09efd02df7caaa8abd37a55ae0bebf9cfa29
2019-04-04 16:34:05 -07:00
Christopher Ferris
4a6483923c Merge "Fix off by one reading build id." into qt-dev 2019-04-04 21:47:42 +00:00
Yifan Hong
0558e58214 CgroupSetupCgroups: don't leak fd.
- If file is unlinked, the mmapped region is still there.
- If file is truncated, a SIGBUS will be seen, and holding
  the fd doesn't help.

Test: boots (sanity)
Bug: 123664216
Change-Id: I6683804bc795fab6798891a4471e5fe58fbffe13
Merged-In: I6683804bc795fab6798891a4471e5fe58fbffe13
2019-04-04 13:14:10 -07:00
Yifan Hong
d588728951 libcgrouprc: version script: linux only
mac builds doesn't support version script.
This fixes the build.

Test: pass

Fixes: 129905103

Change-Id: Ia3d06e4eff05b41982b3dfbb946efa41358b2c76
2019-04-04 18:48:16 +00:00
Hridya Valsaraju
4113cf749e Open image files in binary mode
This is required for read() to function correctly
in Windows since it behaves differently in text mode and
binary mode and may cause unpredictable behavior depending
on the contents of the image file.

Bug: 129281908
Test: fastboot.exe flashall
Change-Id: I64370af44a050bafea60ff1b0b2be18cc531480a
Merged-In: I64370af44a050bafea60ff1b0b2be18cc531480a
(cherry picked from commit 1a6f6feff4)
2019-04-04 09:48:29 -07:00
Christopher Ferris
a46de76024 Fix off by one reading build id.
Update unit tests and add new build id displaying in offline unwinds.

Bug: 129873279

Test: All unit tests pass.
Test: Verify that debuggerd displays build id properly.
Change-Id: I97f4a204842447a20c812f535a458155b937d5e1
Merged-In: I97f4a204842447a20c812f535a458155b937d5e1
(cherry picked from commit 1760b45709)
2019-04-04 09:26:28 -07:00
Jaegeuk Kim
20b0bd9ca4 Merge "libfiemap_writer: test pinned file bit" am: 73bb342956 am: e0df95d8a8
am: fa5dced8ea

Change-Id: I1008eb301eb4b6f813e3a14e739492695c7dd896
2019-04-03 15:21:06 -07:00
Jaegeuk Kim
fa5dced8ea Merge "libfiemap_writer: test pinned file bit" am: 73bb342956
am: e0df95d8a8

Change-Id: I02a0da79d123a8ef7ea13af7ffcef3e3b487dc57
2019-04-03 15:13:03 -07:00
Jaegeuk Kim
e0df95d8a8 Merge "libfiemap_writer: test pinned file bit"
am: 73bb342956

Change-Id: I2a4b5794e2be4c28f2362ed95e8cd75994d02cbd
2019-04-03 15:04:24 -07:00
Treehugger Robot
73bb342956 Merge "libfiemap_writer: test pinned file bit" 2019-04-03 21:31:18 +00:00
Yifan Hong
662eeac40c [automerger skipped] Merge changes from topic "libprocessgroup_rc" am: 25d42eeaa6 am: 8f3d266984
am: 10f7835736 -s ours
am skip reason: change_id I47c46ca9ba5c1fbf3f9f7a1b185dc48b058b1e32 with SHA1 eecba5c11d is in history

Change-Id: I55e5a8c5e71ff037bb391909a167d3b3db69d37a
2019-04-03 14:01:08 -07:00
Yifan Hong
2b040de4d7 [automerger skipped] Add libcgrouprc to ld.config.*.txt. am: 063b6beef0 am: 4e52c76d92
am: 794f523b80 -s ours
am skip reason: change_id I23c3ece44816e4e213f9630b915e19978a259823 with SHA1 169a3e6095 is in history

Change-Id: I27ec2c2dce10b2bbf6929f6b4b4c2ef8fe823e0c
2019-04-03 14:00:12 -07:00
Yifan Hong
0f50989a61 [automerger skipped] libprocessgroup: use libcgrouprc to read cgroup.rc am: 53e0deb7b2 am: c2cb4aa768
am: 30559a8a00 -s ours
am skip reason: change_id I635d9885db62e82f37421f6d20f59c84a6f4cbb2 with SHA1 fad638c82d is in history

Change-Id: I531a2cc66c5374ad0a8ffdd0bb4e6b2294bfbf51
2019-04-03 13:59:24 -07:00
Yifan Hong
8fa5f95050 [automerger skipped] libprocessgroup_setup: use libcgrouprc_format am: d8ce1fb1d1 am: edca509a38
am: 818d7e3678 -s ours
am skip reason: change_id If5e2301a1b65c3f6a51a1661cfeeed4e299f634e with SHA1 1a0996a308 is in history

Change-Id: If71b56793a251a5c318787d680df32be6c9e294e
2019-04-03 13:58:25 -07:00
Yifan Hong
ba414d95c5 [automerger skipped] libprocessgroup: Move CgroupSetupCgroups() to libprocessgroup_setup am: 6f9ce2e548 am: c1c18f9a04
am: e7f9de2cc7 -s ours
am skip reason: change_id I941dc0c415e2b22ae663d43e30dc7a464687325e with SHA1 bd623a4ce0 is in history

Change-Id: Ifec90c82d6e1c58be8c6e1328cb858e6d3a8edcb
2019-04-03 13:57:38 -07:00
Yifan Hong
8298fc6177 [automerger skipped] libprocessgroup: Add libcgrouprc am: 098323ba5b am: 15c6496640
am: 6dc78dc56f -s ours
am skip reason: change_id I9c13c0528461758154e23cbab3a94ade7fb351ee with SHA1 d895647095 is in history

Change-Id: I9233b271e03ec67ff7bfa3ef728d227cc6aef01d
2019-04-03 13:56:51 -07:00
Yifan Hong
7a8be29c1c [automerger skipped] libprocessgroup: Add libcgrouprc_format am: c4b3ab4edc am: 7e7c203528
am: e470498138 -s ours
am skip reason: change_id Iaf6199f759a6264590b13ca7ba6d7f576c3ed56a with SHA1 f4212744ed is in history

Change-Id: Ibcd0a74102a606e7dccc7f65f58cb56968d01fbb
2019-04-03 13:56:06 -07:00
Yifan Hong
10f7835736 Merge changes from topic "libprocessgroup_rc" am: 25d42eeaa6
am: 8f3d266984

Change-Id: Iec5b74b1e6a72f5afd1386f902aae7e942d104cd
2019-04-03 12:54:53 -07:00
Yifan Hong
794f523b80 Add libcgrouprc to ld.config.*.txt. am: 063b6beef0
am: 4e52c76d92

Change-Id: I4c05c28b213a3781cd94b34de64d95c7aaa22320
2019-04-03 12:54:05 -07:00
Yifan Hong
30559a8a00 libprocessgroup: use libcgrouprc to read cgroup.rc am: 53e0deb7b2
am: c2cb4aa768

Change-Id: Icb28519d3ed68751de8bad36611ab090b276a4bb
2019-04-03 12:53:13 -07:00
Yifan Hong
818d7e3678 libprocessgroup_setup: use libcgrouprc_format am: d8ce1fb1d1
am: edca509a38

Change-Id: I584367960506fcc724bb8a20b78cc5091084e131
2019-04-03 12:52:36 -07:00
Yifan Hong
e7f9de2cc7 libprocessgroup: Move CgroupSetupCgroups() to libprocessgroup_setup am: 6f9ce2e548
am: c1c18f9a04

Change-Id: I4d716a985ea666324d3daaaa0d00a5a90cd3c3ea
2019-04-03 12:51:59 -07:00
Yifan Hong
6dc78dc56f libprocessgroup: Add libcgrouprc am: 098323ba5b
am: 15c6496640

Change-Id: I2e6969425516c307275f94d21d8161999eebecd4
2019-04-03 12:51:23 -07:00
Yifan Hong
e470498138 libprocessgroup: Add libcgrouprc_format am: c4b3ab4edc
am: 7e7c203528

Change-Id: Iadd78024c14c6406dda85743e7315b62a338dd1e
2019-04-03 12:50:46 -07:00
Yifan Hong
8f3d266984 Merge changes from topic "libprocessgroup_rc"
am: 25d42eeaa6

Change-Id: I73dab7acb0ae8359572c25e2138e11609d5878ef
2019-04-03 12:35:20 -07:00
Yifan Hong
4e52c76d92 Add libcgrouprc to ld.config.*.txt.
am: 063b6beef0

Change-Id: Iae9ed8a20e0dfed73489ba8973feab62e8d20065
2019-04-03 12:34:03 -07:00
Yifan Hong
c2cb4aa768 libprocessgroup: use libcgrouprc to read cgroup.rc
am: 53e0deb7b2

Change-Id: I154787974376c5bce3d158ac2b70a9444c0fc295
2019-04-03 12:32:51 -07:00
Yifan Hong
edca509a38 libprocessgroup_setup: use libcgrouprc_format
am: d8ce1fb1d1

Change-Id: I43c903bae8fdbe752d70914c088a4770e192af22
2019-04-03 12:31:25 -07:00
Yifan Hong
c1c18f9a04 libprocessgroup: Move CgroupSetupCgroups() to libprocessgroup_setup
am: 6f9ce2e548

Change-Id: I3a0ccd7894d17a83c898718807387968bef44c3a
2019-04-03 12:29:30 -07:00
Yifan Hong
15c6496640 libprocessgroup: Add libcgrouprc
am: 098323ba5b

Change-Id: Ia385e7d0af1b6f0801b9f4c3d88d756acebaa02a
2019-04-03 12:27:30 -07:00
Yifan Hong
7e7c203528 libprocessgroup: Add libcgrouprc_format
am: c4b3ab4edc

Change-Id: I5c24cd183a45d87997118c8fbe26d0b526ed78fd
2019-04-03 12:25:22 -07:00
Yifan Hong
25d42eeaa6 Merge changes from topic "libprocessgroup_rc"
* changes:
  CgroupSetupCgroups -> CgroupSetup
  Add libcgrouprc to ld.config.*.txt.
  libprocessgroup: use libcgrouprc to read cgroup.rc
  libprocessgroup_setup: use libcgrouprc_format
  libprocessgroup: Move CgroupSetupCgroups() to libprocessgroup_setup
  libprocessgroup: Add libcgrouprc
  libprocessgroup: Add libcgrouprc_format
2019-04-03 19:08:51 +00:00
Yifan Hong
bd5853cb48 Merge changes from topic "libprocessgroup_rc"
* changes:
  CgroupSetupCgroups -> CgroupSetup
  Add libcgrouprc to ld.config.*.txt.
  libprocessgroup: use libcgrouprc to read cgroup.rc
  libprocessgroup_setup: use libcgrouprc_format
  libprocessgroup: Move CgroupSetupCgroups() to libprocessgroup_setup
  libprocessgroup: Add libcgrouprc
  libprocessgroup: Add libcgrouprc_format
2019-04-03 16:41:21 +00:00
Julien Desprez
f3ec311a9c Merge "Replace reboot-fastboot by reboot fastboot" am: cd68bda4ec am: d2353d030f
am: 168be967f5

Change-Id: I32b6726dc8b03bf04a161ea3b8ced5aa29dfb923
2019-04-03 02:37:58 -07:00
Julien Desprez
168be967f5 Merge "Replace reboot-fastboot by reboot fastboot" am: cd68bda4ec
am: d2353d030f

Change-Id: I248e96898c155c019e0af826b92520f373e3773e
2019-04-03 02:30:33 -07:00
David Srbecky
50a70173e5 Merge "Check for data races when reading JIT/DEX entries." am: 59c70a5b75 am: 9363485979
am: 4d03a384c2

Change-Id: Ice57130b051b8e2024594856252acea834ffa990
2019-04-03 02:07:55 -07:00
Julien Desprez
d2353d030f Merge "Replace reboot-fastboot by reboot fastboot"
am: cd68bda4ec

Change-Id: I311a3b93b27a8360aa81447d482e6c0c2e2cc404
2019-04-03 01:43:07 -07:00
David Srbecky
4d03a384c2 Merge "Check for data races when reading JIT/DEX entries." am: 59c70a5b75
am: 9363485979

Change-Id: If702c873330b09020dd701f5e786a03ca4d28ac0
2019-04-03 01:39:57 -07:00