summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-12-09storaged: protect global proto_loadedandroid-security-9.0.0_r76android-security-9.0.0_r75android-security-9.0.0_r74android-security-9.0.0_r73android-security-9.0.0_r72android-security-9.0.0_r71android-security-9.0.0_r70android-security-9.0.0_r69android-security-9.0.0_r68android-security-9.0.0_r67android-security-9.0.0_r66android-security-9.0.0_r65pie-security-releaseMark Salyzyn
proto_loaded is not thread safe, so we must protect it with a mutex proto_lock. Signed-off-by: hanhongli@360.cn Signed-off-by: gongguang@360.cn Signed-off-by: Mark Salyzyn <salyzyn@google.com> Bug: 170732441 Test: compile Change-Id: I93416598b6047e890c66b922b360093aa42db8c5 (cherry picked from commit 33206d393c59437da3a4defad8f4c1578ec369bd)
2020-12-09Fix storaged memory leakJoe Yu
storaged try to load user's proto even if it has been loaded before https://partnerissuetracker.corp.google.com/u/2/issues/118719575 Change-Id: Ia7575cdc60e82b028c6db9a29ae80e31e02268b1 (cherry picked from commit 857a63eb6604baa1ed6b0e31839ccce8da18c716) Signed-off-by: Mark Salyzyn <salyzyn@google.com> Bug: 170732441 Test: compile (cherry picked from commit abed883043bcf22ce8bea9a7e7abb88df64311df)
2020-09-10FileMap::create: remove duplicate addition.android-security-9.0.0_r64android-security-9.0.0_r63android-security-9.0.0_r62Elliott Hughes
The previous change was intended to detect the overflow, but accidentally retained the existing addition, so we'd abort before getting to the explicit check. Also reformat slightly to better match the current code in qt-dev and beyond, to reduce merge conflicts. Bug: 156997193 Test: treehugger Change-Id: I73a3a4e75f0aad00888e8f2b49a07b7e8b4eda05 Merged-In: I73a3a4e75f0aad00888e8f2b49a07b7e8b4eda05 (cherry picked from commit 54794ac613d50bf4072174476f60527e2b0b4cdf)
2020-09-10Fail explicitly on length overflow.Christopher Ferris
Instead of aborting when FileMap::create detects an overflow, detect the overflow directly and fail the call. Bug: 156997193 Test: Ran unit tests, including new unit test that aborted before. Change-Id: Ie49975b8949fd12bbde14346ec9bbb774ef88a51 Merged-In: Ie49975b8949fd12bbde14346ec9bbb774ef88a51 (cherry picked from commit 68604b9c29b5bd11e2e2dbb848d6b364bf627d21) (cherry picked from commit 4d14303653247da3922242796ab6d63123fbd004)
2020-08-13libutils: check vsnprintf errorandroid-9.0.0_r61Steven Moreland
For encoding errors, this function will return a negative value which causes problems down the line. Check for an error and return. Also, integer overflows are guarded. Bug: 161894517 Test: fuzzer test case Change-Id: Ia85067d4258bde4b875c832d6223db5dd26b8838 Merged-In: Ia85067d4258bde4b875c832d6223db5dd26b8838 (cherry picked from commit ee22384c54d42149491c8b9dbcda0d8c5e88eddc)
2020-08-06String16::remove - avoid overflowSteven Moreland
Bug: 156999009 Test: libutils_test (cases added) Change-Id: Iad46d95d9848928ba81000090b2fe9aec1e5eaac Merged-In: Iad46d95d9848928ba81000090b2fe9aec1e5eaac (cherry picked from commit f251c1c581f2d1b9940e60e756315c5e15443990) (cherry picked from commit 9a9c8910e9296c9dc8d79c37f589895f5a2a836c) (cherry picked from commit 4048e49956a2dfd49af3adf0f78881bf15f3550f)
2019-11-07FlattenableUtils::align memsetsandroid-9.0.0_r60android-9.0.0_r59android-9.0.0_r58android-9.0.0_r57android-9.0.0_r56android-9.0.0_r55android-9.0.0_r54android-9.0.0_r53android-9.0.0_r52security-pi-releaseSteven Moreland
Bug: 141890807 Test: boot, check data is zero'd Change-Id: I45aaeac369f4c5cf3eb44f61c233e00f870a5c79 (cherry picked from commit bf824f8fa50d9f7390057278fefb58e83323a644) (cherry picked from commit e62a9d7669ac85844d4424474f5c88c096f7160b)
2019-07-11Fix a memory leak in gatekeeper.android-9.0.0_r51android-9.0.0_r50android-9.0.0_r49android-9.0.0_r48Janis Danisevskis
In violation to the documentation of GateKeeper::GetAuthTokenKey and GateKeeper::GetPasswordKey, the implementations in SoftGateKeeper allocate and return buffers and relinquish ownership causing a memory leak, because the caller expects the implementation to retain ownership. Bug: 129768470 Bug: 134557251 Test: gatekeeper-unit-tests Change-Id: I0af9539d3dcd47dfd1e7d80cdee700ea0c2d6d0f Merged-In: I0af9539d3dcd47dfd1e7d80cdee700ea0c2d6d0f (cherry picked from commit 6a9c4e7968e73393110b169b33fb636531fe7fc2)
2019-01-14Export maximum number of fds/ints in a native_handle.Martijn Coenen
So we can deserialize it consisently and safely. Bug: 120084106 Test: builds Change-Id: I0eafff70d3a7e4d732fe600a0052efb90108208d (cherry picked from commit 02debfa2df1589c2f8e35cc2db93dd131f43f2db)
2018-06-21Merge cherrypicks of [4392181, 4392182, 4392183, 4392184, 4392201, 4392202] ↵android-cts-9.0_r1android-9.0.0_r8android-9.0.0_r7android-9.0.0_r6android-9.0.0_r5android-9.0.0_r3android-9.0.0_r2android-9.0.0_r1pie-r2-s1-releasepie-r2-releaseandroid-build-team Robot
into pi-release Change-Id: I82b5577e2ecdbf50a73df940db72964b9c6969af
2018-06-21Determine product partition path on build timeDoheon Lee
Path of product partitoin can be set as /product or /system/product whether generate extra product partition or not. Substitute %PRODUCT% to relevant path to know linker which path should search and permit. Bug: 110286945 Test: m -j # Check /system/etc/ld.config.$(PLATFORM_VNDK_VERSION).txt Change-Id: I6ca177d0c9c5af00ad821879fece40848331fc8d Merged-In: I6ca177d0c9c5af00ad821879fece40848331fc8d (cherry picked from commit cccad0bf8461ab575a5861f9bc68c9f8f69db582) (cherry picked from commit 93d837f3a90acec007647f21ed4573f044fa6f1e)
2018-06-21Add /system/product/* paths to permitted pathsInseob Kim
As linker doesn't resolve paths in permitted paths, /system/product variants should be added to support devices having product partition under /system. Bug: 110286945 Test: m -j succeeds on taimen and libraries under /system can dlopen libraries under /system/product/apps Change-Id: Icd102d44511702e4ec66c07a367b59c3d9700a44 Merged-In: Icd102d44511702e4ec66c07a367b59c3d9700a44 (cherry picked from commit 3918936b9e7fee51828d285a1217c7202d5cb2d1) (cherry picked from commit c4cf62f4b4e9186a897e943b2419fb9a13739c1b)
2018-06-18Merge cherrypicks of [4368877, 4369031, 4369032, 4369033, 4369034, 4368878, ↵android-build-team Robot
4369035, 4369036, 4369008] into pi-release Change-Id: I05769d63a54c76d20b8724dce36b30e54cba9be6
2018-06-18Populate recovery DTBO offset correctlyHridya Valsaraju
Also, remove recovery_dtbo_offset argument for mkbootimg as this is calculated based on sizes of kernel, ramdisk and second binaries. Also, modify unpack_bootimg to use the recovery_dtbo_offset field to extract recovery_dtbo. Test: make recoveryimage showcommands -j32 Bug: 80207223 unpack_bootimg --boot_img $OUT/recovery.img diff recovery_dtbo dtbo.img Change-Id: I588ccc8b739c169b6f78c17ffe554c5562397d98 Merged-In: I588ccc8b739c169b6f78c17ffe554c5562397d98 (cherry picked from commit 26e01bbdc5cb2dcad64d73ec836447b8ded4fc6c) (cherry picked from commit b8371d532d6cd1314954c2d3e9b8a79d3d70e7c7)
2018-06-18Correct comment in boot image headerHridya Valsaraju
Test: make Bug: 80207223 Change-Id: I88cf7683e036ff43bbe3ff5418519c7e35e08b79 Merged-In: I88cf7683e036ff43bbe3ff5418519c7e35e08b79 (cherry picked from commit d0ab4e3701dcec866cb05f4d2a122fbbcabf61cc) (cherry picked from commit f514f6f66aba10f2668481a4d643c7983a0ea93a)
2018-06-07Snap for 4826885 from 820ef1505828e89b704f319311ed0cf4ec73752c to pi-releaseandroid-build-team Robot
Change-Id: Ifbb0531108a6292880957b7f4a4a5225926e32c6
2018-06-06Merge "Parse IfIndex for Netlink RTM_NEWADDR / RTM_DELADDR event" into pi-devTreeHugger Robot
2018-06-06Snap for 4824048 from ea03e1f8412903838b449871190e1279dc79e076 to pi-releaseandroid-build-team Robot
Change-Id: I0f4785f6e473990eb636cea655c7d1c78022de93
2018-06-05liblog: expect content only if ro.logd.kernel is enabledMark Salyzyn
On svelte devices, CTS test liblog#android_logger_get_ fails on the missing kernel buffer because it is not enabled to save space. Test: gTest liblog_unit_tests Bug: 109669791 Change-Id: Iaf46fe9713d3462a56885515a67db640544345ab
2018-06-03Snap for 4818534 from 9bd3ee1c4f14f268b0959edd891ef852b95370b8 to pi-releaseandroid-build-team Robot
Change-Id: Idc9af3a531d434302036e2d1d61e172bd9a7849d
2018-06-01Support /product/binInseob Kim
Bug: 80422611 Test: m -j succeeded and permissions of files under /product/bin are set correctly Change-Id: I83377d809c47c92da6b226d2853ea6a7462fb127 Merged-In: I83377d809c47c92da6b226d2853ea6a7462fb127 (cherry picked from commit 25195daaca079e048e47b38b83fc41527a89ccb0)
2018-06-01Merge "Support product-specific libraries" into pi-devTreeHugger Robot
2018-05-31Camera: add DISABLE error codeYin-Chia Yeh
Test: CTS CameraEvictionTest + IdleUidTest Bug: 77486868 Change-Id: I1411d6667776963435ce25bd643a33c41d224921
2018-05-31Support product-specific librariesInseob Kim
Product-specific libraries in /product/lib can be exposed to Android apps by adding the list of the libs into /product/etc/public.libraries-<companyname>.txt. The libs MUST be named as lib<name>.<companyname>.so. Bug: 73095206 Test: with taimen mma -j and runtest.sh. The libs are all loaded in system, but not in vendor. After reinstalling app using adb -r and reopening app, only libraries listed in .txt are loaded Change-Id: I7c386813c72a7b225a7f244b6c5fec4ac0660fd3 Merged-In: I7c386813c72a7b225a7f244b6c5fec4ac0660fd3 (cherry picked from commit 67cb05654cfa677fd5db33ea0629a9496a9ae907)
2018-05-27Snap for 4807121 from 39edb87aaf21f9bd452f3f164ee90cf7a9e14518 to pi-releaseandroid-build-team Robot
Change-Id: Ie984edd49d1535bd3fc0686a3b6144b2659b25a9
2018-05-24Snap for 4801384 from c70e76f1a4571dbc767a07e809341a73d3cdb289 to pi-releaseandroid-build-team Robot
Change-Id: I33f4e3cdd7a211df7432408c810cf3194112db93
2018-05-24Merge "healthd_mode_charger: unblank the screen only on first frame" into pi-devTreeHugger Robot
2018-05-24Merge "Add cwren to libmetricslogger OWNERS" into pi-devAndrew Chant
2018-05-24Merge "Make per-application memcg hierarchy configurable via a property" ↵TreeHugger Robot
into pi-dev
2018-05-23healthd_mode_charger: unblank the screen only on first frameThierry Strudel
Original code is unblank screen for all frames of the first cycle, unblank is needed only before the first frame of the first cycle. Bug: 74771887 Change-Id: I51d8390e359335a0b1cb127b096db1a8b889b169 Signed-off-by: Thierry Strudel <tstrudel@google.com>
2018-05-23Make per-application memcg hierarchy configurable via a propertySuren Baghdasaryan
Introduce ro.config.per_app_memcg Android property to enable/disable per-application memcg hierarchy. On low-ram devices (ro.config.low_ram=true) ro.config.per_app_memcg defaults to true, otherwise it defaults to false. Bug: 80201565 Test: set ro.config.per_app_memcg=true and verify /proc/<app_pid>/cgroup membership (memory:/apps/uid_xxx/pid_xxx) Test: set ro.config.per_app_memcg=false and verify /proc/<app_pid>/cgroup membership (memory:/) Change-Id: Iabd3ef6c9c16c774b9da959a7f43b5f66df120a3 Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-05-23Merge "Add Hardware Reliabilty metrics to C header" into pi-devAndrew Chant
2018-05-23Add cwren to libmetricslogger OWNERSAndrew Chant
Bug: 69978775 Test: None. Change-Id: Ic48e37fa4a1fa192bcd948954dc056219535e0b8
2018-05-23Snap for 4799153 from 428a6ffaf8fb3b9420180a6f54ad4e0f229c96d7 to pi-releaseandroid-build-team Robot
Change-Id: I8b50c825ba0cdcaedd4729b759cecf5ee3d48a4c
2018-05-22Add Hardware Reliabilty metrics to C headerAndrew Chant
Expose Hardware Reliabilty TRON metrics constants for logging via C++ interfaces. Bug: 69978775 Test: Logged events from Pixelstats HAL Change-Id: I9a1c4467d31f64ae3c43e35b0a4cf5a92157c39f
2018-05-22Merge "Add a new directory to store downloaded apns" into pi-devJordan Liu
2018-05-22Merge "init: finer grained permissions for ctl. properties" into pi-devTom Cherry
2018-05-22Merge "init: allow entering of network namespaces" into pi-devTom Cherry
2018-05-22Merge "Fix bug when doing signal handler lookup." into pi-devChristopher Ferris
2018-05-22init: finer grained permissions for ctl. propertiesTom Cherry
Currently, permissions for ctl. property apply to each action verb, so if a domain has permissions for controlling service 'foo', then it can start, stop, and restart foo. This change implements finer grainer permissions such that permission can be given to strictly start a given service, but not stop or restart it. This new permission scheme is mandatory for the new control functions, sigstop_on, sigstop_off, interface_start, interface_stop, interface_restart. Bug: 78511553 Test: see appropriate successes and failures based on permissions Change-Id: I6ce915ae39954a67eb6fe1795a93cf715c352ae4
2018-05-22Snap for 4796401 from 93d48fe0b6e891d785caefdc02065da58e749c69 to pi-releaseandroid-build-team Robot
Change-Id: I9d5a3d4d48b6944b00e032511151eb1a4a391d4b
2018-05-22Merge "Add files to CleanSpec.mk" into pi-devTreeHugger Robot
2018-05-21lmkd: Do not set soft_limit_in_bytes on high-end devicesSuren Baghdasaryan
Setting memory.soft_limit_in_bytes on high-end devices with large memory reserves affects performance of memory-hungry applications that have large workingsets and keep thrashing because of the memory limits imposed. Limit the usage of memory.soft_limit_in_bytes to low-memory devices only. Add debug messages for future troubleshooting to capture cases when vmpressure events are being ignored. Bug: 78916015 Test: collect vmstat while running a heavy app Change-Id: Ib4434b96d2be802ef89960b573486eae8d12f198 Merged-In: Ib4434b96d2be802ef89960b573486eae8d12f198 Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-05-21Merge changes from topic "generic_by_name" into pi-devTreeHugger Robot
* changes: Adds /dev/block/by-name/<partition> symlinks Removing block device by-num symlinks
2018-05-21Fix bug when doing signal handler lookup.Christopher Ferris
The new lld linker uses all non-zero offset executable maps. There was a bug when trying to find if the stack is in a signal handler that caused the code to read the wrong place in the elf. Fixed by not adding the elf offset to the relative pc. Also fixed the unwind_for_offline tool to dump multiple stacks if necessary. Added new offline unit test that would have failed with the old code. Bug: 79936827 Test: Ran unit tests and libbacktrace unit tests. Test: Dumped backtraces of system pids. Test: Ran 137-cfi art test. Change-Id: Iaca8c18c2a314902e64c3f72831234297e8dcb1b Merged-In: Iaca8c18c2a314902e64c3f72831234297e8dcb1b (cherry picked from commit 239425b9fa91ae13d18cf8158b31663876d07acf)
2018-05-21Add a new directory to store downloaded apnsNiklas Lindgren
downloaded apns-conf.xml will be stored in the folder /data/misc/apns/ to make sure TelephonyProvider gets access. Bug: 79948106 Test: Manual Change-Id: I4ba0596fa6523c0eb96328dbe46ead02587bd9b8 Merged-In: I4ba0596fa6523c0eb96328dbe46ead02587bd9b8
2018-05-21init: allow entering of network namespacesTom Cherry
Add the ability to enter a network namespace when launching a service. Typical usage of this would be something similar to the below: on fs exec ip netns add namespace_name service vendor_something /vendor/... capabilities <lower than root> user not_root enter_namespace net /mnt/.../namespace_name Note changes to the `ip` tool are needed to create the namespace in the correct directory. Bug: 73334854 Test: auto team verified Merged-In: Ifa91c873d36d69db399bb9c04ff2362518a0b07d Change-Id: Ifa91c873d36d69db399bb9c04ff2362518a0b07d (cherry picked from commit aead51b418e70a49191bc0cc5b67c92c969ae699)
2018-05-19Adds /dev/block/by-name/<partition> symlinksBowgo Tsai
During uevent processing, some "by-name" symlinks will be created. /dev/block/<type>/<device>/by-name/<partition> <type> can be: platform, pci or vbd. <device> might be: soc.0/f9824900.sdhci, soc.0/f9824900.sdhci, etc. <partition> might be: system, vendor, system_a, system_b, etc. e.g., on a non-A/B device: /dev/block/platform/soc.0/f9824900.sdhci/by-name/system /dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor On a A/B device: /dev/block/platform/soc/1da4000.ufshc/by-name/system_a /dev/block/platform/soc/1da4000.ufshc/by-name/system_b /dev/block/platform/soc/1da4000.ufshc/by-name/vendor_a /dev/block/platform/soc/1da4000.ufshc/by-name/vendor_b However, those symlinks are "device-specific". This change adds the "generic" symlinks in ueventd, in addition to the existing symlinks, when the possible "boot devices" are specified in device tree. e.g., &firmware_android { compatible = "android,firmware"; boot_devices ="soc/1da4000.ufshc,soc.0/f9824900.sdhci"; } The following symlinks will then be created on the aforementioned non-A/B and A/B devices, respectively. /dev/block/by-name/system /dev/block/by-name/vendor /dev/block/by-name/system_a /dev/block/by-name/system_b /dev/block/by-name/vendor_a /dev/block/by-name/vendor_b Note that both <type> and <device> are skipped in the newly create symlinks. It assumes there is no more than one devices with the same <partition>, which is the assumption of current first stage mount flow. Finally, when 'boot_devices' in DT is absent, it fallbacks to extract 'boot_devices' from fstab settings. e.g., using 'soc/1da4000.ufshc', 'soc.0/f9824900.sdhci' for a fstab with the following content: /dev/block/platform/soc/1da4000.ufshc/by-name/system /dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor Bug: 78613232 Test: adb shell ls /dev/block/by-name Change-Id: Iec920b5a72409b6a2bdbeeb290f0a3acd2046b5d Merged-In: Iec920b5a72409b6a2bdbeeb290f0a3acd2046b5d (cherry picked from commit 8eec38f4e463d8cd980562ec49432c17972cc5cb)
2018-05-19Removing block device by-num symlinksBowgo Tsai
The uevent.partition_num easily collides between partitions, for example: Both /dev/block/sda3 and /dev/block/sdd3 will generate the same symlink: /dev/block/platform/soc/1da4000.ufshc/by-num/p3 This change remove those by-num symlinks as there seems no effective user of it. Bug: 78613232 Test: m init_tests && \ adb push $OUT/data/nativetest64/init_tests/init_tests /data/. && \ adb shell /data/init_tests Change-Id: I8dfa8dc1a2f9fc9296aa30f33e905bf158b501de Merged-In: I8dfa8dc1a2f9fc9296aa30f33e905bf158b501de (cherry picked from commit 95591bd00e653826f25bfa705c3f50545f6b06a3)
2018-05-18Add option to create metadata mount pointPaul Crowley
Test: booted metadata-encrypted device Bug: 79781913 Change-Id: Ie922db20314c04409c98700bfb1aff3d111275f0