summaryrefslogtreecommitdiff
path: root/security/pfe/pfk.c (follow)
Commit message (Collapse)AuthorAge
* Merge remote-tracking branch 'msm8998/lineage-20' into lineage-20Raghuram Subramani2024-10-17
| | | | Change-Id: I126075a330f305c85f8fe1b8c9d408f368be95d1
* ice: fix issue with losing ICE key configuration during resetAndrey Markovytch2017-02-08
| | | | | | | TZ is called to restore key configuration in case of UFS reset Change-Id: Id434e7f9ec6befdce97f52fd350957b66adcb15f Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
* ext4 crypto: enable HW based encryption with ICEAndrey Markovytch2016-09-15
| | | | | | | | | | Numerous changes were introduced to various layers: Block: removed dependency on selinux module for decision on bio merge EXT4: Added feature controlled support for HW encryption PFK: Major re-factoring, separation to eCryptfs and EXT4 sub-layers Change-Id: I9256c8736e1c16175fe3f94733dda430ccc57980 Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
* security: pfe: Fix the qualifier used to print size_tSrinivas Ramana2016-06-22
| | | | | | | | | | Use the correct type qualifier to print size_t and ssize_t. This will fix the compilation errors when compiling for ARM. While at it, fix the compilation errors in pfk_kc.c for sched functions by including sched.h. Change-Id: I4fac4530dd4b31baf62ef3719535fd662dc2ae37 Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
* pfk: fixed crash that occurred because of bio's without dataAndrey Markovytch2016-06-21
| | | | | | | | | bio's without data are not relevant, bio_had_data checks this, replaced redundant checks to call to this function. Also, additional clean ups performed Change-Id: I315bcf43cf3d32e78d53b818571da1f5175f8ac3 Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
* scsi: ufs: ICE 3.0 changesAndrey Markovytch2016-06-09
| | | | | | | | | ICE 3.0 crypto sequences were changed, CTRL_INFO register no longer exists and doesn't need to be configured. The configuration is done via utrd. Change-Id: I5d69436ec59476fc5cd427458d79f8c99266f243 Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
* PFK: fix race between key set and key invalidate in TZAndrey Markovytch2016-04-25
| | | | | | | | | | | | | | | | | | | | When working with multiple files and multiple threads, the following scenario can occur: 1. File Close -> Key cache removal -> context switch 2. Open new file -> occupy the entry cleaned in 1 -> TZ_ES_SET_ICE_KEY -> context switch 3. Back to 1 -> TZ_ES_INVALIDATE_ICE_KEY 4. Back to 2 -> ICE uses the key that is already invalid 5. Crash due to PARTIALLY_SET_KEY_USED To fix this, pfk must know when requests using some key are completed. Only then key removal shall be allowed and until then key invalidation must wait. A new callback was added to let clients inform PFK when requests end. Change-Id: Id7f8a3302fac9fafd1203d8d56ca13d59b45bbd5 Signed-off-by: Gilad Broner <gbroner@codeaurora.org> Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
* eCryptfs: fixed bug in cipher handlingGilad Broner2016-03-25
| | | | | | | | | Cipher was sometimes not treated properly, causing valid requests belonging to eCryptfs to be treated as regular. Change-Id: Iabfb93cc4c9e9e167901043482eb99613ed70343 Signed-off-by: Andrey Markovytch <andreym@codeaurora.org> Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
* pfk: added some additional debug printsAndrey Markovytch2016-03-23
| | | | | | | Also added useful function for translation between inode to filename Change-Id: If0d5db3545a71c85223ef53980ee61f9dbd002d9 Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
* pfk: fixed bug that caused eCryptfs ignore some of its filesAndrey Markovytch2016-03-23
| | | | | | | | | | | Our logic that distinguished eCryptfs files from non eCryptfs ones checked bi_vcnt field in bio to make sure it has valid bio vecs. Apparently this field is not updated in some cases by block layer and in general can't be trusted outside of code that own bio. There is another field that need to be used for this purpose - bi_size Change-Id: Ibf225543618373699a0d5adc3295daf9ded6169a Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
* PFK: fixed bug where key was cleared without turning on clocks firstAndrey Markovytch2016-03-23
| | | | | | | ICE clocks need to be turned on to clear the key, fixed Change-Id: I1cd5a10899c2f128b138fe380beb34a5a310fa05 Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
* PFK: fixed issue where key in TZ was not set properlyAndrey Markovytch2016-03-23
| | | | | | | | When key is set in ICE via TZ, HLOS should send two parts, SALT and the KEY itself according to AES standards. KEY was used for both parts. Change-Id: I453dea289b01bdf49352d5209255966052f5dc1b Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
* PFK: new module to work with ecryptfsAndrey Markovytch2016-03-23
PFK is a new module that accompanies eCryptfs and enables it to utilize ICE hw encryption engine. Module is responsible for storing encryption/decryption keys inside eCryptfs inodes for each file and loading them to ICE Change-Id: I6e755ca657164919147fe0d9482477e14a4be5eb Signed-off-by: Andrey Markovytch <andreym@codeaurora.org> [gbroner@codeaurora.org: fix merge conflicts, adapted LSM hooks and added missing qseecom headers to fix compilation] Signed-off-by: Gilad Broner <gbroner@codeaurora.org>