Commit graph

1610 commits

Author SHA1 Message Date
Android Build Merger (Role)
0d2edbd6ab [automerger] [DO NOT MERGE] Fix signedness mismatch and integer underflow am: ef35553d53 am: 08bd47e9a9 am: 279cc3d65e am: 972b5551f6 skipped: ded6cb5910
Change-Id: I4a1b7a1509d00fba8e35755d2fb198c47e9f3999
2018-10-10 10:26:09 +00:00
Android Build Merger (Role)
ded6cb5910 [automerger] [DO NOT MERGE] Fix signedness mismatch and integer underflow am: ef35553d53 am: 08bd47e9a9 am: 279cc3d65e am: 972b5551f6
Change-Id: I878947630e3cec949dbfa361a379637a30d67a1d
2018-10-10 10:26:07 +00:00
Android Build Merger (Role)
972b5551f6 [automerger] [DO NOT MERGE] Fix signedness mismatch and integer underflow am: ef35553d53 am: 08bd47e9a9 am: 279cc3d65e
Change-Id: If379e03d3998c1267bc66f53b308ea28bcd4c128
2018-10-10 10:26:06 +00:00
Android Build Merger (Role)
279cc3d65e [automerger] [DO NOT MERGE] Fix signedness mismatch and integer underflow am: ef35553d53 am: 08bd47e9a9
Change-Id: Ie536c5dd8c447cd3753725040edbec7ce478ea07
2018-10-10 10:26:04 +00:00
Android Build Merger (Role)
08bd47e9a9 [automerger] [DO NOT MERGE] Fix signedness mismatch and integer underflow am: ef35553d53
Change-Id: I094ac59296a118fbacc70b4ead1230b4d8683fa2
2018-10-10 10:26:02 +00:00
Rubin Xu
ef35553d53 [DO NOT MERGE] Fix signedness mismatch and integer underflow
persist_get_max_entries() is supposed to return an unsigned integer as the
maximum number of entries but it also wrongly returns "-1" as an error
condition. Also fix an issue where an unsigned subtraction in this routine
could lead to integer underflow.

Bug: 112731440
Test: manual
Change-Id: I9672e39bef2c12156dda7806a08c52044962c178
2018-10-10 11:23:54 +01:00
Jeff Sharkey
9a35ab6a4f Merge commit '635193ab36302e5f65e99c7df2f256cfd37068c7' into am-b7f1a67b-2024-4274-aa7d-e88e8cceb407
* commit '635193ab36302e5f65e99c7df2f256cfd37068c7':
  Require quotes when searching for blkid keys.

Bug: 80436257
Test: manual
Change-Id: I4cbae2d594edefa10e5e2c5236d17fe3d37818cd
2018-06-01 16:03:06 -06:00
Android Build Merger (Role)
635193ab36 [automerger] Require quotes when searching for blkid keys. am: ee5c7318d7 am: 98bb129cd3 am: 0c5a0d65c9 am: 7e51f8d0c4 am: 53fe89bbad am: 5716ee6d7a am: 4de0e883d0 am: a7946bf9c6
Change-Id: I831bc503b1fdcf5a6a0c31ac0ded46d301c410ef
2018-06-01 21:46:12 +00:00
Android Build Merger (Role)
a7946bf9c6 [automerger] Require quotes when searching for blkid keys. am: ee5c7318d7 am: 98bb129cd3 am: 0c5a0d65c9 am: 7e51f8d0c4 am: 53fe89bbad am: 5716ee6d7a am: 4de0e883d0
Change-Id: I66ce047987d59d1344cd46e14e07ae0d3cb4bf9a
2018-06-01 21:46:11 +00:00
Android Build Merger (Role)
4de0e883d0 [automerger] Require quotes when searching for blkid keys. am: ee5c7318d7 am: 98bb129cd3 am: 0c5a0d65c9 am: 7e51f8d0c4 am: 53fe89bbad am: 5716ee6d7a
Change-Id: Icf5c0c0a0c4f4aec605182111dcedf16f5a4ab95
2018-06-01 21:46:09 +00:00
Android Build Merger (Role)
5716ee6d7a [automerger] Require quotes when searching for blkid keys. am: ee5c7318d7 am: 98bb129cd3 am: 0c5a0d65c9 am: 7e51f8d0c4 am: 53fe89bbad
Change-Id: I87042d7d1d7b2cf9baeb3f28fd9ab31e5f97f62a
2018-06-01 21:46:08 +00:00
Android Build Merger (Role)
53fe89bbad [automerger] Require quotes when searching for blkid keys. am: ee5c7318d7 am: 98bb129cd3 am: 0c5a0d65c9 am: 7e51f8d0c4
Change-Id: I5f21e49be9c536e51dbaadde0bd53545dc8cbaae
2018-06-01 21:46:06 +00:00
Android Build Merger (Role)
7e51f8d0c4 [automerger] Require quotes when searching for blkid keys. am: ee5c7318d7 am: 98bb129cd3 am: 0c5a0d65c9
Change-Id: I585336447c06e09b499ad2656b731105f1ebc4c4
2018-06-01 21:46:05 +00:00
Android Build Merger (Role)
0c5a0d65c9 [automerger] Require quotes when searching for blkid keys. am: ee5c7318d7 am: 98bb129cd3
Change-Id: I91516dfd0a046aa2763df3c09ef6e8570d7f1b55
2018-06-01 21:46:04 +00:00
Android Build Merger (Role)
98bb129cd3 [automerger] Require quotes when searching for blkid keys. am: ee5c7318d7
Change-Id: If8422cf170db4e05dbe4cf6c1ed4ebf8126b0c71
2018-06-01 21:46:02 +00:00
Jeff Sharkey
ee5c7318d7 Require quotes when searching for blkid keys.
In combination with a blkid change, this prevents the parsing logic
from getting confused by key names appearing inside values.  (The
blkid change suppresses any quotes that appear inside values.)

Bug: 80436257
Test: manual
Change-Id: I9480ef6eb78254b812c671950875d0b8918a27c6
2018-06-01 21:12:54 +00:00
Rubin Xu
f8d604caf3 Add secdiscard command for secure deletion of files
This is used by LockSettingsService to delete sensitive credential files.

Bug: 34600579
Test: manual - change device lock under synthetic password, verify
      old data on disk is erased.

Change-Id: I5e11b559ad8818bd2ad2b321d67d21477aab7555
Merged-In: I5e11b559ad8818bd2ad2b321d67d21477aab7555
2017-05-16 13:29:24 +01:00
TreeHugger Robot
c40996e719 Merge "Revert "Revert "Stop dropping caches now we have kernel fix""" into oc-dev 2017-04-30 11:53:22 +00:00
Daniel Rosenberg
c6bf7c7544 Revert "Revert "Stop dropping caches now we have kernel fix""
This reverts commit 8ad0bef7b5.

Bug: 37231161
Test: Boot device with FBE enabled. ls /storage/emulated/0/Android
Unlock device. ls /storage/emulated/0/Android
1st will not be found. Second should be found.

Change-Id: I92c7ad0adaa7bd357e10661a47cc667ac0ff84b4
Merged-In: I92c7ad0adaa7bd357e10661a47cc667ac0ff84b4
2017-04-28 23:56:00 +00:00
Yong Yao
392c4dbdc1 Fix keyname generation issue
The keyname binded to keyring return a wrong string when there are binary char larger than 127,
the sign extension will introduce unexpect FFFFFF string to the keyname.

Bug: 36975893
Test: local build

Change-Id: Iba2f6ef95aeacd08c8d6c72b71e7b92e956ec3fc
Signed-off-by: Ai, Ting A <ting.a.ai@intel.com>
2017-04-21 11:33:36 -07:00
Daniel Rosenberg
8ad0bef7b5 Revert "Stop dropping caches now we have kernel fix"
This reverts commit 6abe6831b5.

Bringing this back temporarily for the same issue on sdcardfs.
Will remove once the kernel issue is resolved.

Change-Id: Ia29ea4fddb7777012a2eea9259f9ac856773fe01
Bug: 37231161
Test: Boot device with FBE enabled. ls /storage/emulated/0/Android
Unlock device. ls /storage/emulated/0/Android
1st will not be found. Second should be found.
2017-04-20 12:38:26 -07:00
Eric Biggers
fa4039b162 vold: unlink ext4 encryption keys rather than revoking them
Unlinking keys rather than revoking them avoids bugs in certain kernel
versions without having to hack around the problem with an arbitrary 20
second delay, which is not guaranteed to be sufficient and has caused
full device hangs like in b/35988361.

Furthermore, in the context of filesystem encryption, unlinking is not
currently supposed to be any less secure than revoking.  There was a
case where revoking (but not unlinking) keys will cause the filesystem
to deny access to files that were previously opened with that key.
However, this was a means of _access control_, which encryption is not
intended to be used for.  Instead, file permissions and/or SELinux
should be used to enforce access control, while filesystem encryption
should be used to protect data at rest independently from access
control.  This misfeature has also been removed upstream (and backported
to 4.4-stable and 4.9-stable) because it caused CVE-2017-7374.

Eventually we'd really like to make the kernel support proper revocation
of filesystem encryption keys, i.e. fully clearing all key material and
plaintext and safely waiting for any affected filesystem operations or
writeback to complete.  But for now this functionality does not exist.
('sync && echo 3 > /proc/sys/vm/drop_caches' can be useful, but it's not
good enough.)

Bug: 35988361
Change-Id: Ib44effe5368cdce380ae129dc4e6c6fde6cb2719
(cherry picked from commit fd7ba5e4c6)
2017-04-04 22:25:24 +00:00
TreeHugger Robot
e6c142174c Merge "Abort migration early when not enough space." into oc-dev 2017-04-04 01:45:42 +00:00
Jeff Sharkey
a0220a5bd4 Abort migration early when not enough space.
Otherwise we potentially waste minutes of the users time copying
data that will never fit.

Also fix bug around storage calculation.  It's confusing, but f_bsize
is not the value you're looking for; the real block size is f_frsize.

Test: builds, boots
Bug: 27590986, 36840579
Change-Id: I77c63e259356824cc75a3adcf3f4af567efdc7aa
2017-04-03 17:13:06 -06:00
Tom Cherry
c61581e7d2 vdc: use libbase logging and log directly to kmsg on boot
Init is no longer calling vdc with logwrapper, so it must take care of
logging to kmsg directly.

Bug: 36278706
Test: observe logging in kmsg on boot and stderr on normal usage

(cherry picked from commit f71511ac41)

Change-Id: Ieb643918f11bdde4f99ec7f3ec083efbb326e809
2017-03-31 20:48:58 +00:00
Jeff Sharkey
fd3dc3c076 Spread around some O_CLOEXEC love.
Also remove some unnecessary SELinux logic when creating image files
for loop devices.

Test: builds, boots, common operations work
Bug: 34903607
Change-Id: I68dfa022ecc39f56c175e786694e0de35b954ca0
2017-03-27 11:13:36 -06:00
Jeff Sharkey
9f912b8cc4 Merge "Add a new "virtual disk" feature." 2017-03-27 15:22:47 +00:00
Jeff Sharkey
fa1c677c1a Add a new "virtual disk" feature.
It's extremely difficult to test storage related logic on devices
that don't have physical SD card slots.  So to support better
debugging and testing, add a new "virtual disk" feature which mounts
a 512MB file through loop device.

It relies on the kernel having the "loop.max_part" value set to
something other than 0 via the boot command line, since that allows
all the existing partition logic to fall into place.

Bug: 34903607
Test: builds, boots, virtual disk works
Change-Id: I04c5b33e37319d867542985a56b7999a9b7cf35d
2017-03-25 23:25:14 -06:00
Shawn Willden
12e72ad921 Add digest support and implementation name to getHardwareFeatures.
Test: Manual
Change-Id: I910dea4fab671436fe5eb2ab35a6ffaa86179b35
2017-03-23 11:26:35 -06:00
Keun-young Park
3918ae6c76 Merge "make shutdown safe for double calls." am: 71fa1068de am: 2f93c657f4
am: 2a8605b9d1

Change-Id: Id1cd83d307e7791359bc6dfd96368f1138ff21d2
2017-03-15 02:56:40 +00:00
Keun-young Park
2a8605b9d1 Merge "make shutdown safe for double calls." am: 71fa1068de
am: 2f93c657f4

Change-Id: I78962b7272ef0c39a133db042f36684fc1324018
2017-03-15 02:52:10 +00:00
Keun-young Park
2f93c657f4 Merge "make shutdown safe for double calls."
am: 71fa1068de

Change-Id: I161c96dc5a44890fffe8fcdf9e0f8fc874df29c0
2017-03-15 02:47:09 +00:00
Treehugger Robot
71fa1068de Merge "make shutdown safe for double calls." 2017-03-15 02:39:51 +00:00
Keun-young Park
a5bbb5e3c1 make shutdown safe for double calls.
- In new shutdown sequence, volume shutdown is requested in two places:
  system_server and init.
- Make VolumeManager.shutdown safe for double calls.
  It crashed before this change.

bug: 36004738
Test: reboot and check last_kmsg for crash / vdc timeout
Change-Id: I296913959b2647b65d66553073f2032545beba57
2017-03-14 17:27:02 -07:00
Bowgo Tsai
3b0a884381 Merge "vold: replacing fs_mgr_read_fstab() with fs_mgr_read_fstab_default()" am: 92f21f5294 am: f53cc1b04a
am: b169603d95

Change-Id: Ic3ac2ccb853b43d9051d3703f19590cf97b3e689
2017-03-10 03:17:52 +00:00
Bowgo Tsai
b169603d95 Merge "vold: replacing fs_mgr_read_fstab() with fs_mgr_read_fstab_default()" am: 92f21f5294
am: f53cc1b04a

Change-Id: I05095049ec6f478c3b9b31bccd6c828cf52b7d7c
2017-03-10 02:15:05 +00:00
Bowgo Tsai
f53cc1b04a Merge "vold: replacing fs_mgr_read_fstab() with fs_mgr_read_fstab_default()"
am: 92f21f5294

Change-Id: I830cc6be023737b9befc112fdf9b010996314ec9
2017-03-10 02:12:40 +00:00
Treehugger Robot
92f21f5294 Merge "vold: replacing fs_mgr_read_fstab() with fs_mgr_read_fstab_default()" 2017-03-10 02:07:34 +00:00
Bowgo Tsai
e8fb6c3000 vold: replacing fs_mgr_read_fstab() with fs_mgr_read_fstab_default()
The original default /fstab.{ro.hardware} might be moved to /vendor/etc/.
or /odm/etc/. Use the new API to get the default fstab instead of using
the hard-coded /fstab.{ro.hardware}.

Bug: 35811655
Test: boot marlin with /vendor/etc/fstab.marlin
Change-Id: I92d6aefe6ff3433b7d1a671358d990bb7b1f2150
2017-03-09 23:31:18 +08:00
Janis Danisevskis
e7152c38df Fix missing error handling in keymaster comatibility check
The compatibility check assumes that the keymaster session was created
successfully which is a faulty assumption.

This patch adds propper error handling to the check.

Bug: 35576166
Change-Id: I0c70a0e53f488f8bd3164898722f490cd0573ce3
2017-03-08 11:02:30 -08:00
Wei Wang
a3b6d90934 Merge "vold: add coldboot back and make sure it won't block booting" am: b3715cf3af am: 5457b47f9e
am: 660006e7a4

Change-Id: I21e4ba746c99bd8c372d802f11f0bb3f36376553
2017-03-07 20:30:10 +00:00
Wei Wang
660006e7a4 Merge "vold: add coldboot back and make sure it won't block booting" am: b3715cf3af
am: 5457b47f9e

Change-Id: If63bbecc52fec415b38b86ddc32706a3742fcad3
2017-03-07 20:29:11 +00:00
Wei Wang
5457b47f9e Merge "vold: add coldboot back and make sure it won't block booting"
am: b3715cf3af

Change-Id: I725dc07d0bd3afa73081affb56a24e6a216ec9d2
2017-03-07 20:25:40 +00:00
Treehugger Robot
b3715cf3af Merge "vold: add coldboot back and make sure it won't block booting" 2017-03-07 20:24:01 +00:00
Calin Juravle
4c4958d706 Merge "Vold: Clean up code related to foreign dex use" am: 61a7d1a815 am: aaa95fbdfe
am: 0a8d4511c8

Change-Id: I3a84eca8a285bed3ec42c8744db8974e0109fb65
2017-03-07 19:10:47 +00:00
Calin Juravle
0a8d4511c8 Merge "Vold: Clean up code related to foreign dex use" am: 61a7d1a815
am: aaa95fbdfe

Change-Id: I71276a5d18d6c81c97b6c31086a7d9eef47fece4
2017-03-07 19:08:15 +00:00
Calin Juravle
aaa95fbdfe Merge "Vold: Clean up code related to foreign dex use"
am: 61a7d1a815

Change-Id: I296f71434198c41c9ba340891efaf472e3d69dd6
2017-03-07 19:06:15 +00:00
Calin Juravle
61a7d1a815 Merge "Vold: Clean up code related to foreign dex use" 2017-03-07 19:00:18 +00:00
Wei Wang
2edbe28add vold: add coldboot back and make sure it won't block booting
coldboot is needed when device rebooted with USB device attched
so Vold netlink won't miss the information.
This CL added back coldboot and moved down so that it won't block
vold cl and ccl threads.

Bug: 36007238
Test: reboot marlin with flash drive attached and flash drive is recognized
Change-Id: Ie39f348e97a8500515e394e386541289a91b2425
2017-03-06 17:49:37 -08:00
Calin Juravle
3a68f14192 Vold: Clean up code related to foreign dex use
We simplified the way we track whether or not a dex file is used by
other apps. DexManger in the framework keeps track of the data and we
no longer need file markers on disk.

Test: device boots, foreign dex markers are not created anymore

Bug: 32871170
Change-Id: Id0360205b019be92049f36eab4339f4736e974f4
2017-03-03 18:24:21 -08:00