Commit graph

6188 commits

Author SHA1 Message Date
Treehugger Robot
fb3c316d41 Merge "Don't use std::allocator::pointer" into main am: 55af483b78 am: 1e1940d434
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2901505

Change-Id: I82bbc9bad9f7bd4ba20226ab9113f2b398dccf86
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-11 22:41:07 +00:00
Treehugger Robot
1e1940d434 Merge "Don't use std::allocator::pointer" into main am: 55af483b78
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2901505

Change-Id: I110e19f98b191da52c353e979dfa4e00da270d7f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-11 21:55:22 +00:00
Treehugger Robot
55af483b78 Merge "Don't use std::allocator::pointer" into main 2024-01-11 21:22:05 +00:00
Tomasz Wasilczyk
786b395266 Don't use std::allocator::pointer
It's removed in C++20

Bug: 175635923
Test: m MODULES-IN-system-vold
Change-Id: Ief2875bfd3e2d2e5023ad4c0bb754a616fd42419
2024-01-10 00:01:58 +00:00
Eric Biggers
19e70b247e Merge "Remove userSerial param from vold methods that don't use it" into main am: 7730a4944f am: d7b3c40507
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2871777

Change-Id: I61aba5960a5eb117ed72e3c97066db527a8490e8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-05 20:59:12 +00:00
Eric Biggers
d7b3c40507 Merge "Remove userSerial param from vold methods that don't use it" into main am: 7730a4944f
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2871777

Change-Id: I7ed86185213bec08b4e626df05b356c4fc1358f8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-05 20:29:48 +00:00
Eric Biggers
7730a4944f Merge "Remove userSerial param from vold methods that don't use it" into main 2024-01-05 19:09:29 +00:00
Eric Biggers
a5a468c431 Remove userSerial param from vold methods that don't use it
createUserStorageKeys(), unlockCeStorage(), and prepareUserStorage()
have a user serial number parameter, but they don't actually do anything
with it except log it.  Remove this unnecessary parameter.

Bug: 316035110
Test: presubmit
Flag: N/A, mechanical refactoring
Change-Id: I73ebae1afb2bdb7ca856b40b34ce806fdda718fe
2024-01-04 22:39:43 +00:00
Eric Biggers
f5233746ca Merge "vold: remove session keyring workaround for old kernels" into main am: 69c4d769ed am: 987629c024
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2834717

Change-Id: I7632e659955dc9e7df47a9a0643fe0669f51b917
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-04 19:18:24 +00:00
Eric Biggers
987629c024 Merge "vold: remove session keyring workaround for old kernels" into main am: 69c4d769ed
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2834717

Change-Id: I7efb8ff4d350d02611956e6c118e164dfc50e9ca
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-04 18:46:59 +00:00
Eric Biggers
69c4d769ed Merge "vold: remove session keyring workaround for old kernels" into main 2024-01-04 18:21:23 +00:00
Eric Biggers
0e87a83cba vold: remove session keyring workaround for old kernels
The android-4.14-stable and later kernels support the
FS_IOC_ADD_ENCRYPTION_KEY and FS_IOC_REMOVE_ENCRYPTION_KEY ioctls.  This
has superseded the old way of adding fscrypt keys to the kernel, which
was to use the add_key() syscall to add keys to the "session" keyring.
On kernels that support the ioctls, Android doesn't use the obsolete
way.  Since upgrading even just to Android 14 requires at minimum a
android-4.14-stable kernel (according to
https://source.android.com/docs/core/architecture/kernel/android-common#compatibility-matrix),
there is no need to support the obsolete way anymore.

Therefore, this commit removes the code that added and removed keys
to/from the session keyring.  Now the ioctls are used unconditionally.

Flag: N/A for the following reasons:
      - Removing obsolete code, which is fairly safe
      - Very early code, so runtime flag cannot be used
      - This topic also removes code from init, which cannot use aconfig
        libraries because they do not support recovery_available

Bug: 311736104
Test: Build and boot Cuttlefish
Change-Id: I0d9abbda77b1ac838ea6f014dbe22ab032c0e5ae
2023-12-05 19:39:33 +00:00
Daniel Rosenberg
caceb0aae1 Merge "Add support for 16k F2FS" into main am: 1dd20644dc am: 057ea22258
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2836451

Change-Id: I2d0326a46081b3347ba549f8c48ab9c39c177008
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-01 23:11:40 +00:00
Daniel Rosenberg
2213944986 Merge "Add support for 16k F2FS" into main am: 1dd20644dc am: a6fcafe382
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2836451

Change-Id: I860125d475e75f2bccc7fcb82fde10bc4627ac0f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-01 23:10:47 +00:00
Daniel Rosenberg
057ea22258 Merge "Add support for 16k F2FS" into main am: 1dd20644dc
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2836451

Change-Id: I8ffea2f471bfb36ceaffc3cb6fb143f7474d7d32
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-01 22:47:58 +00:00
Daniel Rosenberg
a6fcafe382 Merge "Add support for 16k F2FS" into main am: 1dd20644dc
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2836451

Change-Id: I2be3d858550a9a24524db0bf1cafbe0b671b1da4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-01 22:36:30 +00:00
Daniel Rosenberg
1dd20644dc Merge "Add support for 16k F2FS" into main 2023-12-01 21:16:02 +00:00
Daniel Rosenberg
fb2bf902fd Add support for 16k F2FS
Currently F2FS block size must match page size, so this just does that.
If we support page size != block size for F2FS, this should be
revisited.

Bug: 279820706
Test: Boot 16K device
Change-Id: I6b3b367cdf76ccf5b2c5d309499027a5e7383a44
Signed-off-by: Daniel Rosenberg <drosen@google.com>
2023-12-01 01:07:22 +00:00
Jaegeuk Kim
f62b79a22e Merge "Use logical path to handle different dm target per boot" into main am: c322b82524 am: 11ebdeb460
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2825095

Change-Id: Ide7bf8e06d5058a42b3f2517dd0360ad9df3de2f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-15 02:44:57 +00:00
Jaegeuk Kim
bb2c2fa395 Merge "Use logical path to handle different dm target per boot" into main am: c322b82524 am: ffa86e0a00
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2825095

Change-Id: I25e537ea42200708fa33831cc8ac94d0c476ac49
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-15 02:42:59 +00:00
Jaegeuk Kim
ffa86e0a00 Merge "Use logical path to handle different dm target per boot" into main am: c322b82524
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2825095

Change-Id: I7ac7964c817d1004e8975f793feb280072b9c3a5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-15 02:11:58 +00:00
Jaegeuk Kim
11ebdeb460 Merge "Use logical path to handle different dm target per boot" into main am: c322b82524
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2825095

Change-Id: I11b390b157eeed8a851ee857c92c42b791c4e657
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-15 02:11:50 +00:00
Jaegeuk Kim
c322b82524 Merge "Use logical path to handle different dm target per boot" into main 2023-11-15 01:38:42 +00:00
Jaegeuk Kim
95c61b3391 Use logical path to handle different dm target per boot
When using multiple partitions, f2fs stores all the device paths, but we cannot
guarantee the dm targets are all the same across boot cycles.

Bug: 287247093
Change-Id: Ie4308a27548d4e814924afb656478cfa55fcf8b6
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2023-11-13 16:59:56 -08:00
Jahdiel Alvarez
057135b14d Merge "Verify if pid actually killed for processes with open files" into main am: ef22c8f122 am: ce591b7564
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2806219

Change-Id: Ib10797e318c0e4b92e46c3f9fd9c252579264ff2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-01 19:10:40 +00:00
Jahdiel Alvarez
b152564ced Merge "Verify if pid actually killed for processes with open files" into main am: ef22c8f122 am: f97bb9485e
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2806219

Change-Id: Ie23d405d66d4b7b3348f8c33f91efe2b049ce18f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-01 19:09:15 +00:00
Jahdiel Alvarez
ce591b7564 Merge "Verify if pid actually killed for processes with open files" into main am: ef22c8f122
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2806219

Change-Id: I2397ce76b6c1fa1fee806d0c8f3dc35c6a6ac0eb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-01 18:23:35 +00:00
Jahdiel Alvarez
f97bb9485e Merge "Verify if pid actually killed for processes with open files" into main am: ef22c8f122
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2806219

Change-Id: I0b4d38161da10dfa2532931e58bbe13164c8073a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-01 18:20:51 +00:00
Jahdiel Alvarez
ef22c8f122 Merge "Verify if pid actually killed for processes with open files" into main 2023-11-01 18:02:35 +00:00
Jahdiel Alvarez
d7c42966b9 Verify if pid actually killed for processes with open files
Its possible for vold to read a pid from procfs, the pid is killed
externally and then vold tries to kill it. In this scenario, we sleep
for 5s without needing it. Verify the return value from the kill syscall
and validate that the pid was killed, if the pid didn't exist at the
moment of the kill call, then don't count the pid as being killed.

Test: Boots successfully
Bug: 307801020
Change-Id: Ie127108b85be7249cf8b2881f4917d653d032186
2023-10-30 09:50:48 -07:00
Eric Biggers
6ce48b8402 Merge "Rename "user key" methods in vold" into main am: b5c02ec925 am: 4695ab0a41
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2787028

Change-Id: Ied023815c910721733603fd098108c415331c404
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-25 17:10:55 +00:00
Eric Biggers
d1420c8159 Merge "Rename "user key" methods in vold" into main am: b5c02ec925 am: 7eb9a899be
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2787028

Change-Id: Id52ea7d17299d4bf18ace2084b927e44a5e96c04
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-25 17:09:29 +00:00
Eric Biggers
4695ab0a41 Merge "Rename "user key" methods in vold" into main am: b5c02ec925
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2787028

Change-Id: Id6f7a18e4d662062df50f86a8910f2d5613c2dcc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-25 16:44:06 +00:00
Eric Biggers
7eb9a899be Merge "Rename "user key" methods in vold" into main am: b5c02ec925
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2787028

Change-Id: I5325a46b67cb76319a7d1f06f76e46587be78b08
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-25 16:42:06 +00:00
Eric Biggers
b5c02ec925 Merge "Rename "user key" methods in vold" into main 2023-10-25 16:24:44 +00:00
Eric Biggers
a53a66caed Rename "user key" methods in vold
Rename methods that refer to "user key" to be more precise about what
they mean.  For more details, see the corresponding frameworks/base
changes (I202ebbfd2b4f79fedb3ed120a8ad81500c126894 and
I5894beb97823dced5954e405d779fada49c79e8d).

No change in behavior except for some changed log messages.

Flag: exempt, mechanical refactoring only
Test: presubmit
Change-Id: I9edcb557172395f4f6cf8e837efcc06fcfefb37d
2023-10-19 19:58:46 +00:00
Eric Biggers
c6fa21391c Merge changes If530edaf,I7f11a135,I28412f24,Ia27a61fa,If221e239 into main am: f15785a54d am: 56e7c29466 am: 24a5445880 am: 1a2598d77d
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2777079

Change-Id: I87f95a1074b6c82778cb63ca264e97cf1c3c2b4f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-06 22:18:56 +00:00
Eric Biggers
7177cdad85 Evict adoptable storage CE and DE keys when possible am: 1eddb7cb6d am: 51961be5c0 am: 11dd35816f am: 7ad54533d6
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2685268

Change-Id: I71abfc49d44359f20c71acca7e00194092e6e129
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-06 22:18:54 +00:00
Eric Biggers
e37ee0f1d7 Don't erase key from s_new_ce_keys on eviction am: 0798ed5470 am: 5c04a6034f am: a5c24c9b89 am: 9cd6136633
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2777078

Change-Id: I877cd0acef6c49abc15adf08be77de0678a836e8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-06 22:18:51 +00:00
Eric Biggers
87ee928382 Call fscrypt_destroy_volume_keys() under mCryptLock am: 7862729266 am: 82b0c1e67f am: b14cdca7e7 am: 04304226f9
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2777077

Change-Id: I09878f85d51a1345bf8eb5e81a0c1959788373e3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-06 22:18:49 +00:00
Eric Biggers
f3b0d263f5 Fold read_and_install_user_ce_key() into fscrypt_unlock_user_key() am: fc1df0eae0 am: db7a017bdd am: 988342f572 am: 66fdfbcfe3
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2777076

Change-Id: Ia8f13fc2a170938524772a3b70fe475451adf619
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-06 22:18:47 +00:00
Eric Biggers
1a2598d77d Merge changes If530edaf,I7f11a135,I28412f24,Ia27a61fa,If221e239 into main am: f15785a54d am: 56e7c29466 am: 24a5445880
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2777079

Change-Id: I8cfec06342f3c41e1b0f078003206cca8abf3689
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-06 21:46:27 +00:00
Eric Biggers
7ad54533d6 Evict adoptable storage CE and DE keys when possible am: 1eddb7cb6d am: 51961be5c0 am: 11dd35816f
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2685268

Change-Id: Icbdc9126a4ff2738bd5c3bd09e80aaa55076bec6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-06 21:46:24 +00:00
Eric Biggers
9cd6136633 Don't erase key from s_new_ce_keys on eviction am: 0798ed5470 am: 5c04a6034f am: a5c24c9b89
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2777078

Change-Id: I1ad69037eee1e20549eba3e878781994313c079b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-06 21:46:21 +00:00
Eric Biggers
04304226f9 Call fscrypt_destroy_volume_keys() under mCryptLock am: 7862729266 am: 82b0c1e67f am: b14cdca7e7
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2777077

Change-Id: I462653f9791c70afc26aba229cf2c0fa40cd9b73
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-06 21:46:17 +00:00
Eric Biggers
66fdfbcfe3 Fold read_and_install_user_ce_key() into fscrypt_unlock_user_key() am: fc1df0eae0 am: db7a017bdd am: 988342f572
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2777076

Change-Id: Ie1e999b1257d1a38a81f53cf7ff705869c11ad52
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-06 21:46:14 +00:00
Eric Biggers
24a5445880 Merge changes If530edaf,I7f11a135,I28412f24,Ia27a61fa,If221e239 into main am: f15785a54d am: 56e7c29466
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2777079

Change-Id: I138a741fd8c39a9c88397b7ae9d34f47cdd81859
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-06 21:13:35 +00:00
Eric Biggers
11dd35816f Evict adoptable storage CE and DE keys when possible am: 1eddb7cb6d am: 51961be5c0
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2685268

Change-Id: If66c6364c4ee40ffd512f0d903a9b478b6f9cf6e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-06 21:13:33 +00:00
Eric Biggers
a5c24c9b89 Don't erase key from s_new_ce_keys on eviction am: 0798ed5470 am: 5c04a6034f
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2777078

Change-Id: I921d6e3bcb4fbf8bf403fbc252451549c8790c5c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-06 21:13:30 +00:00
Eric Biggers
b14cdca7e7 Call fscrypt_destroy_volume_keys() under mCryptLock am: 7862729266 am: 82b0c1e67f
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2777077

Change-Id: I1c408c84b2852b67558a93fc34b02c6fa11043e9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-06 21:13:27 +00:00