Commit graph

38688 commits

Author SHA1 Message Date
Jeff Vander Stoep
d885890e78 Logd: include app package name in selinux metadata
Note: denial metadata is currently only included on debug builds.

avc: denied { read } for comm="getprop" name="u:object_r:net_dns_prop:s0"
dev="tmpfs" ino=19605 scontext=u:r:untrusted_app:s0:c164,c256,c512,c768
tcontext=u:object_r:net_dns_prop:s0 tclass=file permissive=0 b/12345678
app=android.selinuxtargetsdkcurrent.cts

Bug: 9496886
Bug: 68016944
Test: cts-tradefed run cts -m CtsSelinuxTargetSdkCurrentTestCases
Change-Id: I1700722a45b75d22f17ba4edc7b95cbaf99fdda8
2018-05-03 22:40:18 -07:00
android-build-prod (mdb)
8cf185e542 Merge "Fixing a bug introduced due to refactoring var names" 2018-05-04 05:30:34 +00:00
Christopher Ferris
25e2bbf874 Remove unnecessary references to libunwind.
Bug: 79209464

Test: Builds.
Change-Id: I4193ac664e3b118270a17fcc0131fb6c6e384c41
2018-05-03 17:59:45 -07:00
Josh Gao
a3d95cf2f8 Merge "tombstoned: make missing O_TMPFILE workaround actually work around." 2018-05-04 00:55:08 +00:00
David Anderson
0b8e22eb5f fs_mgr: target-agnostic device-mapper helpers
Remove "verity" from device-mapper helper functions so it's clear they can be
re-used for non-verity targets.

Bug: 78914864
Test: AVB device still boots

Change-Id: Id8474b2c6e23e828eff563263ebb409031cde17e
2018-05-03 16:35:09 -07:00
android-build-prod (mdb)
1d87ffd3f6 Merge changes I809d8c2e,I11265375
* changes:
  fs_mgr: clean up dm ioctl flags
  init: refactor first stage to not require fstab
2018-05-03 23:33:36 +00:00
android-build-prod (mdb)
57adfb84aa Merge "tombstoned: don't bail out if we fail to unlink a file that isn't there." 2018-05-03 23:28:48 +00:00
Christopher Ferris
c5943fd3fa Merge "Remove unnecessary references to libunwind." 2018-05-03 23:05:51 +00:00
Josh Gao
f5974aedc4 tombstoned: make missing O_TMPFILE workaround actually work around.
We can't actually link an unlinked file back onto disk if it wasn't
opened with O_TMPFILE. Switch to using a temporary filename instead.

Bug: http://b/77729983
Test: agampe
Change-Id: I1970497114f0056065a1ba65f6358f08b51ec551
2018-05-03 16:05:32 -07:00
Max Bires
b8716687f1 Fixing a bug introduced due to refactoring var names
SELinux messages weren't properly filtering into the events buffer
because message_len was being used to determine length of event data
instead of str_len

Bug: 65597269
Test: SELinux denials show up in the events buffer
Change-Id: I857e10211f71dd0db33a272241c7051c5d0c59ca
(cherry picked from commit 3a5acdaa8d)
2018-05-03 15:25:02 -07:00
android-build-prod (mdb)
708364e650 Merge "bootstat: add reboot,rescueparty" 2018-05-03 21:46:22 +00:00
Josh Gao
28f8cf0f97 tombstoned: don't bail out if we fail to unlink a file that isn't there.
Test: crasher with no tombstones
Change-Id: I20e0537a347dd1f83877150ab13f53441dd65d95
2018-05-03 14:31:08 -07:00
Christopher Ferris
8548d55b45 Remove unnecessary references to libunwind.
Bug: 79209464

Test: Builds.

Change-Id: I79f7b0123bc802e3e12d218e888c30dedf5204dc
2018-05-03 14:24:38 -07:00
android-build-prod (mdb)
abf6a2e1ad Merge "healthd: Add elsk as OWNERS" 2018-05-03 20:54:37 +00:00
Elliott Hughes
c1d4026341 Merge "Tell the build system about APCT's requirements." 2018-05-03 20:14:32 +00:00
Mark Salyzyn
75046897b3 bootstat: add reboot,rescueparty
Reserve this for Android system use.

Test: none
Change-Id: Iaf29f0fcd1fe68962cf1109843d6452d0ab42e3c
2018-05-03 13:13:34 -07:00
android-build-prod (mdb)
fcfbaa2ad6 Merge "Update shell and utilities docs." 2018-05-03 19:44:18 +00:00
Yifan Hong
a922d6b596 healthd: Add elsk as OWNERS
Test: none
Change-Id: I676621ced38308296c32259c9525a8d55948e937
2018-05-03 12:25:00 -07:00
Elliott Hughes
4c4b30d7b7 Update shell and utilities docs.
For both P and Q.

Bug: N/A
Test: N/A
Change-Id: I85572bd71871a30c5e6761e098c0d4c63563e873
2018-05-03 11:02:07 -07:00
Elliott Hughes
03d183aecc Tell the build system about APCT's requirements.
Bug: N/A
Test: N/A
Change-Id: I8a67e1ce5acc4142387878ba0bb542da0861e700
2018-05-03 10:06:45 -07:00
David Anderson
5a4db628ee fs_mgr: clean up dm ioctl flags
DM_READONLY_FLAG should only be used when loading tables, and
DM_STATUS_TABLE_FLAG should only be used when querying a table's status. This
patch cleans up how we set flags to reflect when the kernel actually cares
about them.

Bug: 78914864
Test: AVB device still boots

Change-Id: I809d8c2ef2105849ebdd095bbe7f08f15ae63465
2018-05-02 18:46:20 -07:00
android-build-prod (mdb)
fb8b76fe55 Merge "Compile toolbox's newfs_msdos for the host" 2018-05-02 21:55:04 +00:00
android-build-prod (mdb)
294d41cb83 Merge "tombstoned: don't create tombstones for failed dumps." 2018-05-02 21:43:03 +00:00
android-build-prod (mdb)
dbc4aa1ded Merge "Fix a debuggerd test expectation." 2018-05-02 21:41:43 +00:00
Dan Willemsen
a228822c7d Compile toolbox's newfs_msdos for the host
For potential use with build/make/tools/fat16copy.py

Bug: 63035155
Test: mmma system/core/toolbox; newfs_msdos
Change-Id: I8ad50b8c181fc4ec21e191ec9fea8e9aa11d2d9b
2018-05-02 13:14:51 -07:00
David Anderson
29954f6062 init: refactor first stage to not require fstab
In order to support dm-linear devices, we need an additional first-stage
step to ensure that required devices are created. This must happen before
setting up dm-verity or mounting any first-stage partitions.

This patch refactors FirstStageMount so that having a compatible fstab
is optional. This will let us use InitRequiredDevices on systems that
would not otherwise perform first-stage mounts.

Bug: 78914864
Test: non-AVB devices still boot
Change-Id: I11265375a9900d983da8cabcc77d32c503ded02e
2018-05-02 12:23:15 -07:00
Elliott Hughes
89722709b4 Fix a debuggerd test expectation.
70d8f28945 broke a test that was not
expecting to see the new detail about the signal's sender.

Bug: http://b/78594105
Test: ran tests
Change-Id: Idfa3a53b9e664308efdba560ffbb1401c1904530
2018-05-02 10:49:13 -07:00
Bowgo Tsai
78393951de Merge "First-stage mount: avoid triggering a FATAL error" 2018-05-02 02:16:58 +00:00
android-build-prod (mdb)
8ef8d1eb6b Merge "adb: Avoid waiting for emulator connections" 2018-05-02 01:46:12 +00:00
Luis Hector Chavez
c587f02cc6 adb: Avoid waiting for emulator connections
This change exempts the emulator connections from
WaitableConnection.WaitForConnection(). This is because emulator
connections are a) more reliable and b) handled a bit differently than
normal TCP connections.

Bug: 78991667
Test: emulator -showkernel ; adb shell
Change-Id: I552946198889a82d6c265f45e8c3b38f6ac9d045
2018-05-01 17:12:16 -07:00
Bowgo Tsai
8fe363f260 First-stage mount: avoid triggering a FATAL error
Related AOSP changes:
  1. https://android-review.googlesource.com/#/c/platform/system/core/+/405009/
  2. https://android-review.googlesource.com/#/c/platform/system/core/+/532637/

The second CL raises a FATAL error when it detects fstab-dt has no content
during first-stage mount. However, with the first CL, the fstab-dt entry
might be "skipped" when bootloader sets the status property to a value
other than "ok"/"okay". (e.g., to skip mounting /vendor on upgrading
devices which have no vendor partition).

Use LOG(INFO) when there is nothing to mount here. The later stages
should trigger a FATAL error when some important files in those
partitions are not available, e.g., SEPolicy files.

Bug: 78441220
Test: boot a device
Change-Id: Iae2f47d455679298bdb067d96b771a30c1a82e6f
2018-05-01 16:39:36 +08:00
Tao Bao
49b7f296b9 Merge changes from topic "libsparse-callback"
* changes:
  fastboot: Track the libsparse API change.
  libsparse: Use 'size_t' for the 'len' parameter in callbacks.
2018-04-30 21:48:46 +00:00
Elliott Hughes
4e6f3d9603 Merge "Add test_suites lines." 2018-04-28 16:02:40 +00:00
android-build-prod (mdb)
c314d4db9f Merge "crash_dump: defuse our signal handlers earlier." 2018-04-27 23:29:00 +00:00
android-build-prod (mdb)
2666955d3d Merge "adb: Make the Connection object a std::shared_ptr" 2018-04-27 23:16:37 +00:00
Elliott Hughes
40fdf3f4ab Add test_suites lines.
Bug: N/A
Test: builds
Change-Id: Ic5e2b9206bcfcb53c774989013b5db6aab462e42
2018-04-27 16:12:06 -07:00
Josh Gao
38ac45df17 crash_dump: defuse our signal handlers earlier.
We have a LOG(FATAL) that can potentially happen before we turn off
SIGABRT. Move the signal handler defusing to the very start of main.

Bug: http://b/77920633
Test: treehugger
Change-Id: I7a2f2a0f2bed16e54467388044eca254102aa6a0
2018-04-27 13:31:47 -07:00
android-build-prod (mdb)
65027d9d80 Merge "adb: Add a way to distinguish between connection failures and successes" 2018-04-27 19:51:25 +00:00
android-build-prod (mdb)
584e2fe709 Merge "Remove misleading comment." 2018-04-27 00:49:30 +00:00
android-build-prod (mdb)
b802255b06 Merge "Show signal sender for SI_FROMUSER signals." 2018-04-26 21:16:57 +00:00
Luis Hector Chavez
9a388d5387 adb: Make the Connection object a std::shared_ptr
This change is in preparation to allow the TCP-based transports to be
able to reconnect. This is needed because multiple threads can access
the Connection object. It used to be safe to do because one instance of
atransport would have the same Connection instance throughout its
lifetime, but now it is possible to replace the Connection instance,
which could cause threads that were attempting to Write to an
atransport* to use-after-free the Connection instance.

Bug: 74411879
Test: system/core/adb/test_adb.py
Change-Id: I4f092be11b2095088a9a9de2c0386086814d37ce
2018-04-26 13:53:35 -07:00
Luis Hector Chavez
56fe753070 adb: Add a way to distinguish between connection failures and successes
This change adds a callback that is invoked exactly once, either when
the connection is fully established (i.e. CNXN packets have been sent
and received) or the atransport object is deleted before that (because
the connection failed).

This helps in distinguishing between successful and failing connections
for TCP. Especially when there is some kind of port
forwarding/multiplexing in between (like an SSH tunnel or SSLH proxy).

Bug: 74411879
Test: adb connect chromebook:22 (which runs an sslh tunnel to adbd).
      either succeeds or fails, but not fake-succeeds.

Change-Id: I7e826c6f5d4c30338a03b2d376a857ac5d05672a
2018-04-26 13:53:35 -07:00
Mika Raento
da2535c0ea Merge "Systrace support for NNAPI" 2018-04-26 17:01:32 +00:00
Elliott Hughes
70d8f28945 Show signal sender for SI_FROMUSER signals.
Suicide doesn't change:

  signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------

But homicide now looks like this (this is `sleep 666` killed by
`kill -SEGV` as root:

  signal 11 (SIGSEGV), code 0 (SI_USER from pid 4446, uid 0), fault addr --------

Bug: http://b/78594105
Test: manual
Change-Id: I8c2feafba8cc5a3db85e8250004d428a464c5d9e
2018-04-26 08:19:17 -07:00
Mika Raento
2c2e3e89b0 Systrace support for NNAPI
Change-Id: I5abf283b5fb04725ec0b8ffbb8191fbddec1766b
Bug: 78137932
Test: mm
2018-04-26 09:34:22 +01:00
Elliott Hughes
efbbe6120b Merge changes Iefcb1ec9,I6df97295
* changes:
  Rewrite get_sched_policy_name for safety.
  cutils: add restricted cpuset
2018-04-25 23:46:53 +00:00
Elliott Hughes
9f49508f36 Rewrite get_sched_policy_name for safety.
This way you'll get a build time error if you make the usual mistake of
adding to the enum but not adding an entry to the array.

Also improve the unit tests, and fix get_sched_policy_name's incorrect
behavior on invalid inputs.

Bug: N/A
Test: ran tests
Change-Id: Iefcb1ec9ef66267837da7a576c8be3d0cfb16cd0
2018-04-25 14:55:48 -07:00
Elliott Hughes
c8a8771b6b Merge "Make ziparchive-tests run standalone." 2018-04-25 21:38:13 +00:00
Tim Murray
419ba9e2aa cutils: add restricted cpuset
(cherrypick of 658ae90f69 without the init.rc change)

Bug: 78197570
Test: CTS
Change-Id: I6df972950b75a839caa463ae282ad000b959e8ae
2018-04-25 14:30:37 -07:00
Elliott Hughes
bde0ec9e00 Make ziparchive-tests run standalone.
We need to (a) tell soong to copy our data and (b) automatically find
our data relative to our executable.

The real point of this is to be able to run these tests in APCT and
presubmit.

Bug: N/A
Test: ran tests on host and device, from a variety of directories
Change-Id: I4c0be1ac60f03953fdd5ba6e3d15b1aaa37ed019
2018-04-25 12:50:17 -07:00