summaryrefslogtreecommitdiff
path: root/secdiscard.cpp
Commit message (Collapse)AuthorAgeFilesLines
* secdiscard: should call fsync to avoid reordering IOsJaegeuk Kim2019-08-121-0/+4
| | | | | | | | | | | Don't make stale zero'ing IO in block device after unlink, since filesystem can reuse the block addresses and issue some IOs. If block layer reordered two IOs, filesystem will see zero data, which crashes filesystem consistency. Bug: 136964285 Test: run cts -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.CrossProfileAppsHostSideTest Change-Id: I43c13622d094cecda1c53468adc240002111d605 Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
* vold: cleanups for O_CLOEXEC tidy checks.Nick Kralevich2019-03-291-1/+2
| | | | | | Bug: 129350825 Test: compiles and boots Change-Id: I83a484ca15df1b757b670008f15af5504bc94df1
* Remove excess logging in secdiscardRubin Xu2019-03-211-3/+1
| | | | | | | | Remove all debug logs to reduce logspam a bit. Bug: 64349233 Test: manual Change-Id: I234fae7b9fb719b09af27985736f43f085dad301
* clang-format many files.Paul Crowley2018-09-181-30/+29
| | | | | Test: Format-only changes; treehugger suffices. Change-Id: I23cde3f0bbcac13bef555d13514e922c79d5ad48
* fix wrong ioctl direction for F2FS_IOC_GET_PIN_FILEJaegeuk Kim2018-09-121-1/+1
| | | | | Change-Id: I0cf212c3e1770e233ae1f70e7fc4a6d70b82583e Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
* secdiscard: should pin_file to avoid moving blocks in F2FSJaegeuk Kim2018-08-021-0/+28
| | | | | | | | | This file should avoid F2FS GC, since it directly access block device based on fibmap. Bug: 111659036 Change-Id: I15aef8175c23ba4029eb580e2dba59c77cca8227 Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
* Move functions useful for crypto test into their own filePaul Crowley2017-06-161-74/+4
| | | | | | | | More refactoring in advance of work on bug. Bug: 36029169 Test: compiles. Change-Id: Ic4cdd4761e4c2b11a3ddca5c3bbc4d5e42fac9d4
* Abolish AutoCloseFD.h in favour of unique_fdPaul Crowley2017-06-161-6/+7
| | | | | | | | | Android has a standard way to do what AutoCloseFD.h does, so use that instead. Refactor before work on the bug. Bug: 36029169 Test: Deleted a user and checked that secdiscard logs looked good. Change-Id: I5d8bedfb3fa1f032fd2bced88b1b561e4a8c2ff4
* Zero out blocks if BLKSECDISCARD failsPaul Crowley2016-07-111-9/+32
| | | | | | | | | | On a device where we can't BLKSECDISCARD sectors, we "overwrite" them with zeroes. This changes the FTL to remap those sectors to new locations. With this done, the old contents are accessible only given a compromise of flash firmware or a die level attack. Bug: 26021231 Change-Id: Ia065921389886fac1ba456c19c138187237c2561
* Use android-base logging not cutils in secdiscardPaul Crowley2016-01-121-17/+17
| | | | | | | Much nicer C++ style logging, but the main reason is to clean up AutoCloseFD.h so I don't have to use cutils to use it. Change-Id: I7a7f227508418046eecce6c89f813bd8854f448a
* Make deletion of larger files possible.Paul Crowley2015-11-171-41/+55
| | | | | Bug: 22502684 Change-Id: I9034af1ce919bff51f836e5bf51cc2585089440e
* Add --no-unlink option to secdiscard for testing.Paul Crowley2015-11-021-9/+39
| | | | | | Also allow deletion of multiple files in one invocation. Change-Id: I5011bf45f2d3b91964bc68fd8e61ec037e1de2ca
* secdiscard.cpp: Use getmntent and my newfound C++ knowledge.Paul Crowley2015-11-021-130/+59
| | | | | Bug: 19706593 Change-Id: I6254e0339ab42fdbecda80c6f37e64c323329190
* Fix erroneous comment in secdiscard.cpp, plus style fixes.Paul Crowley2015-06-241-13/+9
| | | | | | Bug: 19706593 Change-Id: I9c1442f31cc6b6507225a5aa9ad07be6042d69ce
* Scrub the key from the disk with BLKSECDISCARD.Paul Crowley2015-06-171-0/+240
Bug: 19706593 Change-Id: Ib91b5182413b5dca6d0e1fdda7990ea0973843bb