data node encrypted file system: secure deletion for flash memory · 2020. 8. 10. · secure...

51
Data Node Encrypted File System: Secure Deletion for Flash Memory Joel Reardon Srdjan ˇ Capkun David Basin ETH Zurich, Switzerland 9.8.12 1

Upload: others

Post on 19-Jan-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Data Node Encrypted File System:Secure Deletion for Flash Memory

Joel Reardon Srdjan Capkun David BasinETH Zurich, Switzerland

9.8.12

1

Page 2: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Secure deletion: security task of deleting information suchthat it becomes irrecoverable (to a coercive attacker)

2

Page 3: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Secure Deletion Problem

3

Page 4: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Secure Deletion Easily Solved for Block Devices

block device layout

4

Page 5: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Secure Deletion Easily Solved for Block Devices

block device layout after overwriting file data

5

Page 6: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Secure Deletion not Trivial for Log-Structured FSes

log-structured device layout

6

Page 7: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Overwriting in Log-Structured File Systems

log-structured device layout after overwriting file data

7

Page 8: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Why are log-structured file systems relevant?Paradigm is ubiquitously used for flash memory

(ubiquitously used for portable devices)

8

Page 9: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

YAFFS (used on Android phones)

YAFFS is a log-structured file system

deleted data remains with average use upwards of 48 hours andmonths with infrequent use

9

Page 10: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Log-Structured File Systems and Flash Memory

flash memory holds electrical charge without powererasing is a brute operation that fills the charge of many cellswriting is a surgical operation that drains particular cells

erasures are costly: power, wear, timeerasure is natural efficiency metricerasures should also be evenly levelled

10

Page 11: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Naive Approach

erase blocks contain an eclectic mixture of colocated data

11

Page 12: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Naive Approach

deleted all data in this way is very costly

12

Page 13: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Design Goals

possible solutionsonly securely delete sensitive filesencrypt each file with a keydrain charge from remaining cells (scrubbing)

what we want to achievework within specification of flash memorybe transparent to the application and userssmall cost in space, memory, and computationefficient fine-grained secure deletion

13

Page 14: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Our contributions

Data Node Encrypted File System (DNEFS)general file system change that affords efficient secure deletion

UBIFSecfull implementation of DNEFS for the Linux Flash File system UBIFS

14

Page 15: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Data Node Encrypted File System (DNEFS)

intuition:we need (at least) to erase an erase block to delete some data

without batching, this reduces to the inefficient naive solution

goal now is to maximize ratio of bytes deleted to erase blocks erased

solution:encrypt each data node with a unique keycolocate the keys in a (dense) key storage area (KSA)periodically purge KSA to remove deleted keys

15

Page 16: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

DNEFS Outline

16

Page 17: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

DNEFS Write

17

Page 18: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

DNEFS Write

18

Page 19: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

DNEFS Write

19

Page 20: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

DNEFS Write

20

Page 21: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

DNEFS Read

21

Page 22: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

DNEFS Read

22

Page 23: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

DNEFS Read

23

Page 24: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

DNEFS Read

24

Page 25: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Key State Map and KSA

25

Page 26: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Key State Map and KSA

26

Page 27: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Key State Map and KSA

27

Page 28: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Key State Map and KSA

28

Page 29: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Key State Map and KSA

29

Page 30: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Key State Map and KSA

30

Page 31: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Key State Map and KSA

31

Page 32: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Introducing UBIFSec: our secure deletion implementationfor the UBI file system (UBIFS)

32

Page 33: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

UBIFS: on top of UBI

33

Page 34: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

UBIFSec

34

Page 35: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

UBIFSec Implementation

UBI provide logically-referenced KSA, atomic updates withdeletion, automatic wear levelling

DNEFS cryptographic operations during UBIFS compression

DNEFS integrated with the checkpoint and replay mechanism inUBIFS

DNEFS key states managed by UBIFS’s index

fully implemented as a single patch, incremental patching ongoing

35

Page 36: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

We tested UBIFSec in simulations and running as filesystem for a Google Nexus One Android phone.

36

Page 37: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Erase Block Wear

Purge PEB erasures Lifetimeperiod per hour (years)Stardard UBIFS 21.3 84160 minutes 26.4 67930 minutes 34.9 51215 minutes 40.1 4475 minutes 68.5 2621 minute 158.6 113

1

37

Page 38: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Throughput and Power Consumption

YAFFS UBIFS UBIFSec

Read rate (MiB/s) 4.4 3.9 3.0Power usage (mA) 39 39 39GiB read per % 5.4 4.8 3.7

Write rate (MiB/s) 2.4 2.1 1.7Power usage (mA) 30 46 41GiB written per % 3.8 2.2 2.0

1

38

Page 39: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Summary

secure deletion for flash memory problem is not straightforwardwe propose DNEFS: secure deletion by periodic purging of a smallkey area

each data node is stored encrypted, with its key in the key areaprovides guaranteed fine-grained secure deletion againstcomputationally-bounded adversary

we implement DNEFS: UBIFSec extends UBIFS to include ourdesign

fully implemented into the file system without sacrificing featuresadditional wear, space and computation are reasonableUBIFSec runs normally on an Android phone

DNEFS can also be integrated into hardware flash controllers aswell as software flash file systems

extended to an encrypted file system by simply encrypting theKSA with a passphrase

39

Page 40: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Why do we replace both unused and deleted keys withnew random values?

40

Page 41: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Peek-a-boo Attacker

41

Page 42: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Peek-a-boo attacker without unused replacement

42

Page 43: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Peek-a-boo attacker performs a peek attack

43

Page 44: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Peek-a-boo attacker with unused replacement

44

Page 45: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Peek-a-boo attacker performs a peek attack

45

Page 46: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Encrypting Whole File

we still need seek()

ECB: semantic security

CTR-like, CBC-like: efficient modifications

CTR-like, CBC-like with IVs per datanode: our solution

46

Page 47: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Data Node Size

Data node size KSA size Copy cost(flash pages) (EBs per GiB) (EBs)

1 64 08 8 0.1164 1 0.98512 0.125 63.984096 0.016 511.98

1

47

Page 48: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Optimization: long-term and short-term data

each time we GC a data node, we may promote it to a higherrange of KSA

KSA is divided into ranges of expected life time

we promote by heuristics: how many times we’ve had to copy thedata around

getting a new key is low-cost: we have to anyway copy the data

48

Page 49: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Adding support for encrypted file system

currently, all the data is encrypted, but the keys are plaintexttrivial change to turn it into password-protected volume

encrypt the entire KSA with a single key derived from a passwordmore efficient than to have a second encryption layer on top

49

Page 50: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Generalizing to FTL

our solution is a general techniqueencrypt blocks at smallest granularitycolocate keys in a logically-referenced migrating KSAperiodically update the KSA’s blocks to delete data

could be extended to Flash Translation Layer (FTL)used for SD card, USB sticks, etc.maps logical sectors to flash addressesallows normal (e.g., FAT) file systems to be mountedvary in implementation, but all the same principle

50

Page 51: Data Node Encrypted File System: Secure Deletion for Flash Memory · 2020. 8. 10. · secure deletion for ash memory problem is not straightforward we propose DNEFS: secure deletion

Generalizing to FTL

in the mapping of sector to flash address, also put a key positionwhen mounting, after this mapping is built, then determine the set ofused keys

reserve a set of erase blocks for storing keyslast page of each block has a magic number, logical KSA number andpurging epoch numberperiodically purge the KSA

file system must issue TRIM commands to the FTL to notifyunused sectors

should be the case regardless

51