Commit Graph

19251 Commits

Author SHA1 Message Date
Elliott Hughes 21f99c089e Merge "Use const auto&/auto&& in adb." 2015-10-07 23:54:17 +00:00
Nick Kralevich e2b2996d96 fs_config.c: remove setuid from procrank
procrank only exists on userdebug/eng builds. For those builds,
procrank can be executed by running "su 0 procrank" instead of
relying on the binary being setuid root. This reduces the number
of setuid binaries on Android and allows for the deletion of
SELinux policy to support this.

Bug: 18342188
Change-Id: I982283f2e0f6fbe5efaffc08501c1ec175f65373
2015-10-07 16:41:47 -07:00
Mark Salyzyn 2b25c66070 logd: clearAll by UID speedup
- If doing a clear, skip accounting
- Ensure for busy checking, behind a region lock for instance, only
  break out if there was something to do. Basically move the filter
  actions first, and defer checking the region lock to the ends of
  the loops.

Bug: 23711431
Change-Id: Icc984f406880633516fb17dda84188a30d092e01
2015-10-07 16:24:57 -07:00
Mark Salyzyn c5dc970edc logd: clear return and deal with busy if readers locked
- Propagate to caller the clearing errors, busy blocked by reader.
- For clear, perform retries within logd with a one second lul each,
  telling readers to skip, but on final retry to kill all readers if
  problem still persists due to block reader (or high volume logspammer).

Bug: 23711431
Change-Id: Ie4c46bc9480a7f49b96a81fae25a95c603270c33
2015-10-07 16:23:57 -07:00
Mark Salyzyn de4bb9c1a7 logd: update region lock after entry has passed to reader socket
- The reader region level indicates the location to protect, but once
  it has been passed to the calling reader, then allow us to go
  one beyond so that a clear or prune thread can remove the entry.

Bug: 23711431
Change-Id: I0f2389858dd8c83366c034360f67d7c363625b56
2015-10-07 16:23:57 -07:00
Mark Salyzyn 603b8e50c8 logcat: do not exit buffer loop on error
- Alter logcat to collect error(s) for open, clear, get size or set
  size; moving on to other buffer ids. Then after loop completed,
  report and exit for the last error reported.

Bug: 23711431
Change-Id: I63a729d27544ea8d5c6119625c1de0210be0eb70
2015-10-07 16:23:54 -07:00
Elliott Hughes 65fe2516b4 Use const auto&/auto&& in adb.
Change-Id: I74a7e511302e15e207906f572d181634e0ed5604
2015-10-07 16:11:17 -07:00
Mark Salyzyn 86eb38f3ca logd: clientHasLogCredentials false negatives
Vote three times in /proc/pid/status to look for AID_LOG group

If not, we may default to the callers UID, and the net result is
to perform the task related to that UID. For adb logcat and
shell logcat, the UID is AID_SHELL which typically has no logs,
leaving no net action taken.

Bug: 23711431
Change-Id: I2b5900a2d37173bd995eb308ee9ecafa20602b62
2015-10-07 16:08:28 -07:00
Elliott Hughes ab590f232f am 28a3e495: am 1407b286: Merge "Fix adb -d/-e error reporting."
* commit '28a3e4958e74c4a3537e36329a3511410918c4e4':
  Fix adb -d/-e error reporting.
2015-10-07 22:56:51 +00:00
Elliott Hughes 28a3e4958e am 1407b286: Merge "Fix adb -d/-e error reporting."
* commit '1407b28628afec6c06eb6cb818f800083df668e1':
  Fix adb -d/-e error reporting.
2015-10-07 22:49:15 +00:00
Elliott Hughes 1407b28628 Merge "Fix adb -d/-e error reporting." 2015-10-07 22:38:50 +00:00
Elliott Hughes 8d28e191c5 Fix adb -d/-e error reporting.
If -d/-e fail, get-serialno and friends will now report an error
and return a failure status code on exit.

Also fix the behavior of -d/-e with $ANDROID_SERIAL --- -d/-e
should override $ANDROID_SERIAL, not the other way round.

I'm deleting my own comment here about always returning "unknown"
for scripts. I can't find any evidence that there are scripts
relying on that, so I think my comment meant "I fear that there
are scripts doing so".

Bug: http://b/24403699
Change-Id: Ie13a751f1137abcfe0cc6c46a0630ba5e02db676
2015-10-07 15:35:18 -07:00
David Zeuthen 8e15f8d096 am 8c06f8cc: am 10bb4e51: Merge "init.rc: mkdir /data/misc/update_engine 0700 root root"
* commit '8c06f8ccd41c5d1206d721b4f19dd6b5ede9ad9e':
  init.rc: mkdir /data/misc/update_engine 0700 root root
2015-10-07 20:34:18 +00:00
David Zeuthen 8c06f8ccd4 am 10bb4e51: Merge "init.rc: mkdir /data/misc/update_engine 0700 root root"
* commit '10bb4e5161ecca1a9660d1e5967b3fb5e7662839':
  init.rc: mkdir /data/misc/update_engine 0700 root root
2015-10-07 20:29:00 +00:00
David Zeuthen 10bb4e5161 Merge "init.rc: mkdir /data/misc/update_engine 0700 root root" 2015-10-07 20:18:36 +00:00
Bertrand Simonnet a3f5bad431 am a4d9a59a: am 9e45f201: Merge "metricsd: Rename build_target_id to product_id."
* commit 'a4d9a59a0782b666f58063820f643250347c7d0b':
  metricsd: Rename build_target_id to product_id.
2015-10-07 20:06:23 +00:00
Bertrand Simonnet a4d9a59a07 am 9e45f201: Merge "metricsd: Rename build_target_id to product_id."
* commit '9e45f201d1ef924788bea56c48b9fce1a5dc30f0':
  metricsd: Rename build_target_id to product_id.
2015-10-07 20:01:08 +00:00
Bertrand Simonnet 9e45f201d1 Merge "metricsd: Rename build_target_id to product_id." 2015-10-07 19:49:43 +00:00
David Zeuthen 159147853e init.rc: mkdir /data/misc/update_engine 0700 root root
Ensure that /data/misc/update_engine exists since it will be referenced
by selinux policy.

Bug: 23186405
Change-Id: I96e4ff341086da6474ef7f7c934f1f35bffc1439
2015-10-07 14:00:55 -04:00
Mark Salyzyn 8dca570538 am 07c50b02: am 58b136cb: Merge "logcat: continue where we left off"
* commit '07c50b02d70f69a1f6cd2eb1272734c593c93ee8':
  logcat: continue where we left off
2015-10-07 14:42:47 +00:00
Mark Salyzyn 07c50b02d7 am 58b136cb: Merge "logcat: continue where we left off"
* commit '58b136cbebe8526134ea9d7e89835b523f1cbe2e':
  logcat: continue where we left off
2015-10-07 14:36:30 +00:00
Mark Salyzyn 58b136cbeb Merge "logcat: continue where we left off" 2015-10-07 14:25:53 +00:00
Badhri Jagan Sridharan ca2a0bdcb5 adbd: Add os descriptor support for adb.
Eventhough windows does not rely on extended os
descriptor for adbd, when android usb device is
configures as a composite device such as mtp+adb,
windows discards the extended os descriptor even
if one of the USB function fails to send
the extended compat descriptor. This results in automatic
install of MTP driverto fail when Android device is in
"File Transfer" mode with adb enabled.

https://msdn.microsoft.com/en-us/library/windows/hardware/gg463179.aspx

BUG=24583401
BUG=chromium:43409

Change-Id: I87341683a9337848cac66daf9055b0d05cedd3d3
2015-10-07 06:04:00 +00:00
Yabin Cui 5a0a146a6a am ff32110e: am 7f9d4c97: Merge "adb: keep file flags in fdevent_install."
* commit 'ff32110e1e061ec100894d915a2d55ecf08608a2':
  adb: keep file flags in fdevent_install.
2015-10-06 23:49:04 +00:00
Yabin Cui ff32110e1e am 7f9d4c97: Merge "adb: keep file flags in fdevent_install."
* commit '7f9d4c97c35bbc5357126731bbb9faad1825c090':
  adb: keep file flags in fdevent_install.
2015-10-06 23:42:37 +00:00
Yabin Cui 7f9d4c97c3 Merge "adb: keep file flags in fdevent_install." 2015-10-06 23:28:36 +00:00
Yabin Cui 6dfef255b8 adb: keep file flags in fdevent_install.
Bug: 24615098
Change-Id: Ia791ecbe612f09aca3bbd5787513f121fae54da5
2015-10-06 16:15:30 -07:00
Bertrand SIMONNET 7dc7827107 metricsd: Rename build_target_id to product_id.
We use product_id instead of build_target_id, the protobuffer should
rename that field too to be consistent.
The same change was made on the backend.

BUG: 24712895
Change-Id: Id9492e3debab986c9df7d4ec0caef8730eb14240
2015-10-06 15:27:37 -07:00
Bertrand Simonnet f1f4852701 am c9772c78: am d1f8e4dc: Merge "metricsd: Expose the metrics status through weave."
* commit 'c9772c780491792e102c6a4c586ca32ecdf5eb59':
  metricsd: Expose the metrics status through weave.
2015-10-06 21:47:19 +00:00
Bertrand Simonnet c9772c7804 am d1f8e4dc: Merge "metricsd: Expose the metrics status through weave."
* commit 'd1f8e4dc9af2b309351bab70dc5eb5a10d939223':
  metricsd: Expose the metrics status through weave.
2015-10-06 21:29:41 +00:00
Mark Salyzyn 9812fc4bd0 logcat: continue where we left off
Issue introduced as part of new logcatd functionality in
commit f3555d9427

Faulty logic, add a gTest to confirm.

Bug: 19608716
Change-Id: Ic1b97def25e03e69faae4398a3dff2ff0f88545e
2015-10-06 12:46:54 -07:00
William Roberts 468573930d debuggerd: audit pid, uid and gid on SE Linux denial
When debugging SE Linux audit messages from debuggerd, its
unclear what process is triggering the access violation. To
assist in debugging, we also log pid, uid and gid.

Before:
avc:  denied  { dump_backtrace } for scontext=u:r:dumpstate:s0 ...

After:
avc: denied  { dump_backtrace } for pid=198 uid=1019 gid=1019 ..

Change-Id: I8263e6f5e77917139b73c3e84b76f7f97fd98003
Signed-off-by: William Roberts <william.c.roberts@intel.com>
2015-10-06 12:25:27 -07:00
Bertrand Simonnet d1f8e4dc9a Merge "metricsd: Expose the metrics status through weave." 2015-10-06 18:45:42 +00:00
Bertrand SIMONNET 59890e2db9 metricsd: Expose the metrics status through weave.
metrics_daemon will export _metrics._AnalyticsReportingState containing
"enabled"/"disabled" depending on the current state and two weave
commands (_metrics._{enable,disable}AnalyticsReporting) to update it.

BUG: 24386281
TEST: manual. Enabled and disabled metrics reporting.
  `metrics_client -c` reports the correct answer.

Change-Id: Ic4a5ffc1e9f9cbc0b47ee34d3af83584d95da155
2015-10-06 10:18:54 -07:00
Bertrand Simonnet 81174408f8 am c5de848c: am a4a479b6: am fcaef687: Merge "metricsd: Don\'t cache the metrics status in the daemon."
* commit 'c5de848c50f0e5b701211076db232f2a0891ff4c':
  metricsd: Don't cache the metrics status in the daemon.
2015-10-05 23:54:57 +00:00
Bertrand Simonnet c5de848c50 am a4a479b6: am fcaef687: Merge "metricsd: Don\'t cache the metrics status in the daemon."
* commit 'a4a479b63b162ed4ff5fb2e1da5a4b7e8714eeec':
  metricsd: Don't cache the metrics status in the daemon.
2015-10-05 23:47:55 +00:00
Bertrand Simonnet a4a479b63b am fcaef687: Merge "metricsd: Don\'t cache the metrics status in the daemon."
* commit 'fcaef687010bc63293087c8232dad2cd0af02b5f':
  metricsd: Don't cache the metrics status in the daemon.
2015-10-05 23:42:40 +00:00
Bertrand Simonnet fcaef68701 Merge "metricsd: Don't cache the metrics status in the daemon." 2015-10-05 23:35:39 +00:00
Elliott Hughes 93d6a5656e am 7d46e889: am 8c47bb52: am 8a69e031: Merge "Speed up adb sync."
* commit '7d46e88936afdfbf10f2cd7ac59d9b2c819bea58':
  Speed up adb sync.
2015-10-05 19:58:13 +00:00
Elliott Hughes 7d46e88936 am 8c47bb52: am 8a69e031: Merge "Speed up adb sync."
* commit '8c47bb52c41f461ee15bf0bc94378f0cc4fcb7d4':
  Speed up adb sync.
2015-10-05 19:53:45 +00:00
Elliott Hughes 8c47bb52c4 am 8a69e031: Merge "Speed up adb sync."
* commit '8a69e0315a3288ca14213602f5bec1173bc3216e':
  Speed up adb sync.
2015-10-05 19:48:00 +00:00
Elliott Hughes 8a69e0315a Merge "Speed up adb sync." 2015-10-05 19:42:03 +00:00
William Roberts d7aea443d9 property_service: log pid,uid and gid of setprop client
When auditing setprop denials, it is often unclear of who the process is
in a multi-process domain. To help identify the invoker, log the pid, uid,
and gid of the caller.

Before:
avc:  denied  { set } for property=wifi.xxx ...

After:
avc:  denied  { set } for property=wifi.xxx pid=30691 uid=123 gid=345 ...

Change-Id: I5cdcb3d18fbd52e0987b5e1497b9f6620c6c742a
Signed-off-by: William Roberts <william.c.roberts@intel.com>
2015-10-05 11:39:56 -07:00
Bertrand SIMONNET a5b40d077f metricsd: Don't cache the metrics status in the daemon.
metrics_daemon should never get a stale answer on whether or not the
metrics are enabled.
This is important as metrics_daemon will be the "source of truth" for
other components.

BUG: 24386281
TEST: unit tests.

Change-Id: I573568abe5d1b840683cede2fdf32cdae028a81a
2015-10-05 09:58:16 -07:00
Mark Salyzyn d0c54deb1d am 8a2f02ba: am f4697688: am bd4f52b2: Merge "liblog: optimize code hotspot"
* commit '8a2f02baa2870fb88353bb6ee4123d776ffd7824':
  liblog: optimize code hotspot
2015-10-05 16:38:09 +00:00
Mark Salyzyn 4a6f04d310 am 1c3009c6: am 2b5f97cc: am 88e01661: Merge "logd: optimize code hotspots"
* commit '1c3009c6443b72cbf5d8d218bc6d115edbaded92':
  logd: optimize code hotspots
2015-10-05 16:38:08 +00:00
Mark Salyzyn 33352bedac am b6a1e850: am be162cf2: am 72146b93: Merge "logd: Add LogUtils.h"
* commit 'b6a1e85004f006b300e161fd2e58cab85bde0fe7':
  logd: Add LogUtils.h
2015-10-05 16:38:06 +00:00
Mark Salyzyn 8a2f02baa2 am f4697688: am bd4f52b2: Merge "liblog: optimize code hotspot"
* commit 'f46976888770c97665e9ccfc33124054f6f40da1':
  liblog: optimize code hotspot
2015-10-05 16:31:08 +00:00
Mark Salyzyn 1c3009c644 am 2b5f97cc: am 88e01661: Merge "logd: optimize code hotspots"
* commit '2b5f97cc0d3ecddcebee0e1ddc79bd7f994dc2b3':
  logd: optimize code hotspots
2015-10-05 16:31:07 +00:00
Mark Salyzyn b6a1e85004 am be162cf2: am 72146b93: Merge "logd: Add LogUtils.h"
* commit 'be162cf236fb790973a05874919cc01f25434481':
  logd: Add LogUtils.h
2015-10-05 16:31:05 +00:00