Commit Graph

1547 Commits

Author SHA1 Message Date
Tej Singh
22d3aa3546 [RESTRICT AUTOMERGE] Fix OOB write in noteAtomLogged am: b13b741a94
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14670131

Change-Id: I705d5c2e025d4e510cd10091e381d8d57f99b78d
2021-06-09 02:38:51 +00:00
Tej Singh
b13b741a94 [RESTRICT AUTOMERGE] Fix OOB write in noteAtomLogged
It's possible for bad atoms to have negative atom ids. This results in
an OOB write when we note that the atom was logged. This adds a
validation check on the logging.

Also added safetynet logging for negative atoms

Bug: 187957589
Test: POC in bug no longer led to the OOB write & crash
Test: checked event log for safetynet logging
Change-Id: I8a6b094c94309d7b02430fb860891ef814efb426
2021-05-20 15:55:27 -07:00
Gavin Corkery
cb6ad6dc8e Merge changes from topic "cp-log-watchdog" into qt-qpr1-dev
* changes:
  Log native crashing process
  Log watchdog-initiated rollback reason
  Add package failure flags to Package Watchdog
2019-12-20 08:02:11 +00:00
Tej Singh
0c4a21e4ea Security Fix: Race Condition + NPE
ShellSubscriber is lazily initialized, and multiple threads can attempt
to write the same pointer since it is not initialized in threadsafe
code. Additionally, there is an NPE that crashes statsd when a null
ResultReceiver is passed in, which allows an attacker to repeatedly
crash statsd until the race condition occurs. More details, including a
proof of concept attack, are in the bug.

Bug: 141243101
Test: repro steps in bug no longer crash statsd
Test: with only the lock on iniitiallizing mShellSubscriber, statsd
still crashed but after ~7 minutes, no race condition occurred.

Change-Id: Ib56f888620497fb41d1627c07867693eb251738e
2019-12-18 12:58:02 -08:00
Gavin Corkery
254b0d5a7f Log watchdog-initiated rollback reason
To help with monitoring Mainline releases, log the reason
for a watchdog-initiated rollback. This may be due to
native crashes, app crashes, ANRs or explicit health check
failures.

Add a mapping from PackageWatchdog failure reason to the
new metrics.

Bug: 146415463
Test: atest PackageWatchdogTest
Test: atest StatsdHostTestCases
Change-Id: Ia3e73d955508297004591eac762555665c557b8a
Merged-In: Ia3e73d955508297004591eac762555665c557b8a
(cherry picked from commit dd1dabaef7)
2019-12-18 14:39:16 +00:00
Chris Wren
bc487b5759 track and report packages with undecorated remoteviews
print query results with:
  adb shell dumpsys notification --remote-view-stats

test the pulled atom with:
  make statsd_testdrive
  ./out/host/linux-x86/bin/statsd_testdrive 10066

Bug: 144855217
Test: atest frameworks/base/services/tests/uiservicestests/src/com/android/server/notification
Change-Id: I6dcc9871f78298a8b213a051223c7316f8feefc5
Merged-In: I773378fc7cfb47a9f9c7495404ddafa63f39cfaf
2019-12-09 15:48:14 -05:00
Mark Tabry
529d73bd4f Add AIDL interface and puller implementation for automotive devices.
Changes:
  - Adds hidden ICarStatsService AIDL API.
  - Adds CarStatsPuller for pulling atoms from ICarStatsService.
  - Pulls VmsClientStats via CarStatsPuller.

Bug: 141697665
Test: Manual testing on hawk using statsd_testdrive
Change-Id: I44e104d430f64b1bd3dce96e9749df79ab3d2fbf
Merged-In: I44e104d430f64b1bd3dce96e9749df79ab3d2fbf
(cherry picked from commit 9dc13578f7)
2019-12-02 13:08:13 -08:00
Mark Tabry
b01c08d0a6 Define new atoms for Vehicle Maps Service.
Bug: 140889664
Test: N/A
Change-Id: I6bf37ed236e81fbcca50046b5a9b649685affb4a
Merged-In: I6bf37ed236e81fbcca50046b5a9b649685affb4a
(cherry picked from commit a824a64be1)
2019-11-20 23:50:45 +00:00
Eric Jeong
4326effee1 Terminate statsd on a few signals including SIGTERM
- statsd is handling SIGHUP/SIGQUIT/SIGINT/SIGTERM, but doesn't exit.
- The expected behaviour is that statsd would exit after finalizing log
processing when those signals are received.

Bug: 139817664
Test: Send SIGTERM to statsd and check if it is terminated. (note that
init will revive statsd)

Change-Id: Id1146d772f8c68892256ee7a3eea70837fee5c7a
(cherry picked from commit 2d99718adf)
(cherry picked from commit 931811bda4e52ba74dd17121b514615f2991583f)
Merged-In: Id1146d772f8c68892256ee7a3eea70837fee5c7a
2019-11-11 18:18:36 +00:00
Mady Mellor
fd48588768 Merge "qt-r1-bubbles-dev @ build 5835883" into qt-qpr1-dev 2019-09-16 21:55:51 +00:00
Tej Singh
2e477bf54b Increase stats hardware rpc threadpool.
Increase the threadpool count to 4.

Test: builds, boots
Test: adb shell cmd stats pull-source 10020 returns a battery capcity
Bug: 139453643
Merged-In: I2929fd6ca300781e67dde97d6196939d7928b350
Change-Id: I2929fd6ca300781e67dde97d6196939d7928b350
(cherry picked from commit 3174c0da99)
2019-09-04 21:22:32 +00:00
Hyunyoung Song
b1814966d6 Merge "create ExclusionRectStateChanged/BackGesture atom" into qt-r1-dev
am: 7e9c5d047d

Change-Id: Ibdf6058b743f20d3434dd189c87ccbf12e82f8f8
2019-08-04 00:59:14 -07:00
Hyunyoung Song
f1b935ea2e create ExclusionRectStateChanged/BackGesture atom
Bug: 135152789
Test: manual
Test: m statsd_testdrive -j31
Test: out/host/linux-x86/bin/statsd_testdrive [223|224]
Change-Id: Id4b36c89ed5bf3330795107fb6cd6750edcd0dbf
Merged-In: Id4b36c89ed5bf3330795107fb6cd6750edcd0dbf
2019-08-02 12:14:25 +00:00
Frank Li
48e0f97d54 Merge changes from topic "DNS telemetry" into qt-r1-dev
am: 412c59128e

Change-Id: I8d479c2054a894da6f700cd38bfd78cdc96f1558
2019-07-25 20:50:47 -07:00
Frank Li
762eb4a215 Add one field(sampling_rate_denom) in NetworkDnsEventReported for recording sample rate.
The sample rate of DNS stats(to statsd) is 1/sampling_rate_denom.

Bug: 119862317
Test: ./out/host/linux-x86/bin/statsd_testdrive 116

Merged-In: Iab542b32a8a18ae0bdbd8e005c430a876f056806
Merged-In: I9d37cac0bca53b3d7c6751ca69c1d304dfe17098
(cherry picked from commit 60d4f1a5bd)

Change-Id: If380a730942195db91a66944f103674c539ca7ad
2019-07-25 22:00:05 +00:00
Frank Li
be8ecaa59e Refine the proto dns_resolver.proto
1. refine the enum type Transport
   The name of 1st enum value is TRANSPORT_UNKNOWN
2. remove the wrong character "CR"

Bug: 119862317
Test: ./out/host/linux-x86/bin/statsd_testdrive 116

Merged-In: Iaf7abac6170d5818a263392731069d7bf021d981
Merged-In: I8f0e7449036062ecc3827e477ced325d84c1bf54
(cherry picked from commit aee26c026c)

Change-Id: Ie33a2ea58d6f39345d0f1d4141eea8b9c458dcfc
2019-07-25 21:57:26 +00:00
Tej Singh
f98ee2cd52 Merge "StatsdStats: improve activation time logging" into qt-dev am: 26b6ef7904
am: 1b5e46fdf5

Change-Id: I5113225dad6a4bb001f6a69e644100eee5e1bed4
2019-06-27 19:39:52 -07:00
Tej Singh
1b5e46fdf5 Merge "StatsdStats: improve activation time logging" into qt-dev
am: 26b6ef7904

Change-Id: I6e92b0274e3a3266038fd91308818c56a83c29ca
2019-06-27 19:19:42 -07:00
TreeHugger Robot
26b6ef7904 Merge "StatsdStats: improve activation time logging" into qt-dev 2019-06-28 02:03:40 +00:00
TreeHugger Robot
9bbe35ee74 Merge "Deprecate the isForeground value because we don't care about it" into qt-r1-bubbles-dev 2019-06-25 23:25:49 +00:00
Tej Singh
16ca28fc8e StatsdStats: improve activation time logging
Add logging to record whenever the 10 second guardrail for sending
active configs changed broadcast is met, so that we know when the
broadcast would not have been sent.
Add activation time for configs that are active when the device boots.
This will help determine whether or not statsd thinks configs are active
and will help debug issues like b/133809948

Bug: 133809948
Test: bit statsd_test:*
Test: manually rebooted to make sure activation time was logged
Change-Id: Ifa72202bc52485e4953e49d78dffea685cc3d1e7
2019-06-25 13:52:58 -07:00
Mady Mellor
daa0a660eb Deprecate the isForeground value because we don't care about it
Test: none
Bug: 135488406
Change-Id: I93630fe11cba87482d79aa57fdddfe341cedd0f8
2019-06-24 16:42:35 -07:00
Rafal Slawik
99c185a729 Merge "Add atom for per-process system ion heap size" into qt-dev
am: 956197e8e0

Change-Id: I236d656d3bcfef05590f8c1262f1fbd5905ddb6b
2019-06-24 15:28:29 -07:00
Ioannis Ilkos
83270da58c Merge "Add anon RSS + swap metric" into qt-dev
am: 9af8d15783

Change-Id: Icdc2f66054c9f1450a731f051707b3824c487865
2019-06-24 08:11:08 -07:00
Rafal Slawik
6d44d6dafa Add atom for per-process system ion heap size
The pulling code will be added in the next commit.

Bug: 130526489
Test: statsd_testdrive
Change-Id: I0fea4b6a7a8dbbdc574fb342c1e07aa0165bf797
(cherry picked from commit 77987ed47f)
2019-06-24 09:54:42 +00:00
Ioannis Ilkos
9af8d15783 Merge "Add anon RSS + swap metric" into qt-dev 2019-06-24 08:46:40 +00:00
Stanislav Zholnin
afc5d42765 Add logging atom for PermissionApps fragment views
am: 32a89c15a7

Change-Id: I72f9f8459637de005b62d8901d1e87f0bcba635e
2019-06-21 08:50:36 -07:00
Stanislav Zholnin
57f15e881c Add atom for logging of AppPermissionsFragment views.
am: dc3e2b35fb

Change-Id: I3aebcc6a68c7d49e207c7e257ef04a47aad1f3ec
2019-06-21 08:46:00 -07:00
Stanislav Zholnin
12f7a5ff0f Add atom for logging views in AppPermissionFragment
am: c9dda9ecdf

Change-Id: I3dbac7f6eaf54cd9b560ea0a6c21d920eef338fb
2019-06-21 08:44:14 -07:00
Stanislav Zholnin
abfa32bbb3 Add logging atoms to record user actions in AppPermissionFragment (handheld devices only)
am: 3e0f9bcce0

Change-Id: I9aba7f2f32ff6a9b6f52532e0d2b45331a4790ca
2019-06-21 08:42:15 -07:00
Stanislav Zholnin
32a89c15a7 Add logging atom for PermissionApps fragment views
Test: make statsd_testdrive && ./out/host/linux-x86/bin/statsd_testdrive -p com.google.android.permissioncontroller 218
Bug: 133401502
Bug: 134581123
Change-Id: I8f41d72c8f96a004911ef68491de8a214da4db24
Add logging to PermissionAppsFragment
2019-06-21 16:39:52 +01:00
Stanislav Zholnin
dc3e2b35fb Add atom for logging of AppPermissionsFragment views.
Test: make statsd_testdrive && ./out/host/linux-x86/bin/statsd_testdrive -p com.google.android.permissioncontroller 217
Bug: 133401502
Bug: 134581123
Change-Id: I60e500e99a13a4f2dea6d7141fc87f5b8422c3a7
2019-06-21 16:26:08 +01:00
Stanislav Zholnin
c9dda9ecdf Add atom for logging views in AppPermissionFragment
Test: ./out/host/linux-x86/bin/statsd_testdrive -p com.google.android.permissioncontroller 216
Bug: 133401502
Bug: 134581123
Change-Id: I099de3a5ecd7ecf68df618b9738a0428e5792c98
2019-06-21 15:20:44 +00:00
Ioannis Ilkos
466ad6c3e0 Add anon RSS + swap metric
We are planning to use this metric to detect leaks.

This CL also decouples the actual memory sampling from AM. This means:
- Less time locking the pid list (we used to lock and then read proc)
- Less serialization / deserialization for the parcel
- Simpler to evolve (e.g. removed the HWM-specific method in AM)

Change-Id: I87a7243156dd8c88cfa85038e7e6cf4963e271e1
Test: manual, MemoryStatUtilTest, UidAtomTests
Bug: b/135418017
2019-06-21 11:10:19 +01:00
Kevin Chyn
7fca2368af Log the amount of time between authentication and error
Fixes: 135705310

Test: Checked logs
Change-Id: I1d9b26befc30f233052504c7c74b17ea0a3d5671
2019-06-21 06:10:40 +00:00
Stanislav Zholnin
9f7663e4b6 Merge "Add logging atoms to record user actions in LocationAccessCheck (handheld devices only)" into qt-dev
am: 762aa842ae

Change-Id: I66b9c6cfa8f19ea0c47f2004ab2193c0fafcd4ec
2019-06-20 22:26:45 -07:00
Stanislav Zholnin
3e0f9bcce0 Add logging atoms to record user actions in AppPermissionFragment
(handheld devices only)

Test: make statsd_testdrive && ./out/host/linux-x86/bin/statsd_testdrive -p com.google.android.permissioncontroller 215
Bug:133401502
Bug:134581123

Change-Id: I2a0b15dfdd6398707a762c48602f970f14534b51
2019-06-21 05:23:33 +01:00
Stanislav Zholnin
375e2ab781 Add logging atoms to record user actions in LocationAccessCheck
(handheld devices only)

Test: make statsd_testdrive && ./out/host/linux-x86/bin/statsd_testdrive -p com.google.android.permissioncontroller 214
Bug:133401502
Bug:134581123
Change-Id: I9f35d2b06cf953441e0986ab23cb842cd155144d
2019-06-20 23:59:59 +00:00
Stanislav Zholnin
c136634c33 Adding atom for logging GrantPermissionsActivity buttons presented and pressed.
am: bdf620b5bd

Change-Id: Ia2f95b336d7e2eafc0949a90526d31f7865c69fd
2019-06-18 05:16:34 -07:00
Stanislav Zholnin
bdf620b5bd Adding atom for logging GrantPermissionsActivity buttons presented and pressed.
Test: make statsd_testdrive && ./out/host/linux-x86/bin/statsd_testdrive -p com.google.android.permissioncontroller 213
Bug:133401502
Bug:134581123
Change-Id: I4c74d590266f89b192605be6f94d038bc2e1bd5a
2019-06-18 11:11:33 +01:00
Stanislav Zholnin
ec9cbdb220 Merge "Atoms for logging permission grants during system upgrade." into qt-dev
am: 58c51d17d1

Change-Id: I90a927891a207971c86b8abebc8cc9c5457a5f2e
2019-06-17 13:16:29 -07:00
Stanislav Zholnin
247d1b75cd Atoms for logging permission grants during system upgrade.
Test: manually verified
Bug:133401502
Bug:134581123
Change-Id: I004704e39c8936de91300b6f98e722d925142c14
2019-06-14 13:13:35 +01:00
Stanislav Zholnin
32bf74150c Merge "Add atom for logging of ReviewPermissionsFragment actions." into qt-dev
am: 15ae30124d

Change-Id: Ideec2a7b87b5089e3b343212cb8656c3326a0e11
2019-06-13 13:27:34 -07:00
TreeHugger Robot
15ae30124d Merge "Add atom for logging of ReviewPermissionsFragment actions." into qt-dev 2019-06-13 20:15:35 +00:00
Tej Singh
52cfa0e455 Merge "Persist metric activation across beta4/5 ota" into qt-dev
am: 12ae95987b

Change-Id: I8d989540dd6807c539026e8c912c581de82b324c
2019-06-08 09:06:32 -07:00
TreeHugger Robot
12ae95987b Merge "Persist metric activation across beta4/5 ota" into qt-dev 2019-06-08 14:38:06 +00:00
Tej Singh
cbf2c64024 Persist metric activation across beta4/5 ota
In beta 4, activeEventActivation proto object does not have a state
field and assumed to be active if it is written to disk. In beta 5, we
add a state field to support persisting metric activation status across
a system server crash. However, if a device updated from beta 4 to 5, we
don't have any knowledge of the state when we read. Therefore, assume
the lack of the state field as the event activation should be active for
the provided ttl.

Bug: 134795027
Test: used flashstation to flash a device to beta 4. Then manually push
and activate a simple config. Then use vendor/google/tools/flashall to
update to qt-dev + this change. Manually ensure metric/config are still
active.
Test: gts-tradefed run gts-dev --module GtsStatsdHostTestCases
Test: bit statsd_test:*

Change-Id: I8594d04efaa2ae1f669113aaffd33e5fa5851e73
2019-06-07 17:56:24 -07:00
Stanislav Zholnin
3d215df180 Add atom for logging of ReviewPermissionsFragment actions.
Test: make statsd_testdrive && ./out/host/linux-x86/bin/statsd_testdrive -p com.google.android.permissioncontroller 211
Bug: 133401502
Bug: 134581123
Change-Id: I326731e70221c1a28568573a241592006d1bb59e
2019-06-07 14:33:42 +00:00
Tej Singh
e4677ac1d2 Merge "Blacklist truncated atoms instead of whitelistnig" into qt-dev
am: 85a3a4689c

Change-Id: I6322b4844a49ef6d5257f29751b7486e14fc6586
2019-06-06 19:49:39 -07:00
TreeHugger Robot
85a3a4689c Merge "Blacklist truncated atoms instead of whitelistnig" into qt-dev 2019-06-07 02:35:51 +00:00