Skip to contentSkip to conversation

generic: test encryption key revocation during concurrent I/O

PATCH New Eric Biggers 1 participant 1 message Mar 31, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 generic: test encryption key revocation during concurrent I/O

From: Eric Biggers <[email protected]>

Add a test which revokes a keyring key while other processes are performing I/O on an encrypted file that was "unlocked" using that key. The crashes unpatched kernels with filesystem encryption enabled.

This bug was present in kernels v4.2 and later. It has been fixed in v4.11-rc4, v4.10.7, v4.9.20, and v4.4.59.

Cc Theodore Ts'o <[email protected]>
Cc Jaegeuk Kim <[email protected]>
Cc Richard Weinberger <[email protected]>
Cc Michael Halcrow <[email protected]>
---
 common/encrypt        |   8 ++++
 tests/generic/500     | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/500.out |   2 +
 tests/generic/group   |   1 +
 4 files changed, 121 insertions(+)
 create mode 100755 tests/generic/500
 create mode 100644 tests/generic/500.out
common/encrypt +8 -0
index f09104d1..85f71d5b 100644
@@ -144,3 +144,11 @@ _unlink_encryption_key()
 	local keyid=$($KEYCTL_PROG search @s logon $FSTYP:$keydesc)
 	$KEYCTL_PROG unlink $keyid >>$seqres.full
 }
+
+# Revoke an encryption key from the keyring, given its key descriptor.
+_revoke_encryption_key()
+{
+	local keydesc=$1
+	local keyid=$($KEYCTL_PROG search @s logon $FSTYP:$keydesc)
+	$KEYCTL_PROG revoke $keyid >>$seqres.full
+}
tests/generic/500 new file +110 -0

110 lines not on this page · raw message

tests/generic/500.out new file +2 -0
new file mode 100644
index 00000000..b46461f3
@@ -0,0 +1,2 @@
+QA output created by 500
+Didn't crash!
tests/generic/group +1 -0
index 0781f35d..037308eb 100644
@@ -422,3 +422,4 @@
 417 auto quick shutdown log
 418 auto rw
 419 auto quick encrypt
+500 auto quick encrypt dangerous
Signature · 1 line
2.12.2.564.g063fe858b8-goog