Speeding Up Linux Disk Encryption

Tuesday, February 25, 2020 - 10:30 am11:00 am

Ignat Korchagin

Abstract: 

Encrypting data at rest is a must-have for any modern SaaS company. And if you run your software stack on Linux, LUKS/dm-crypt is the usual go-to solution. However, as the storage becomes faster, the IO latency, introduced by dm-crypt becomes rather noticeable, especially on IO intensive workloads.

At first glance it may seem natural, because data encryption is considered an expensive operation. But most modern hardware (specifically x86 and arm64) platforms have hardware optimisations to make encryption fast and less CPU intensive. Nevertheless, even on such hardware transparent disk encryption performs quite poorly.

When looking into dm-crypt source code, we noticed that it has a lot of indirection and offloading: instead of encrypting/decrypting IO requests synchronously dm-crypt offloads every operation to a dedicated thread. By making a simple PoC patch and removing all the offloading code we were able to speed up the overall read speed from an encrypted block device by 200%-300% depending on the block size.

This talk aims to revisit the architecture and design choices of the dm-crypt module and research ideas on how to make Linux transparent disk encryption faster.

Ignat Korchagin[node:field-speakers-institution]

Ignat is a systems engineer at Cloudflare working mostly on platform and hardware security. Ignat’s interests are cryptography, hacking, and low-level programming. Before Cloudflare, Ignat worked as a senior security engineer for Samsung Electronics’ Mobile Communications Division. His solutions may be found in many older Samsung smart phones and tablets. Ignat started his career as a security researcher in the Ukrainian government’s communications services.

Open Access Media

USENIX is committed to Open Access to the research presented at our events. Papers and proceedings are freely available to everyone once the event begins. Any video, audio, and/or slides that are posted after the event are also free and open to everyone. Support USENIX and our commitment to Open Access.

BibTeX
@conference {246558,
author = {Ignat Korchagin},
title = {Speeding Up Linux Disk Encryption},
year = {2020},
address = {Santa Clara, CA},
publisher = {USENIX Association},
month = feb
}

Presentation Video