fscrypt: add FS_IOC_REMOVE_ENCRYPTION_KEY_ALL_USERS ioctl
authorEric Biggers <ebiggers@google.com>
Mon, 5 Aug 2019 02:35:47 +0000 (19:35 -0700)
committerEric Biggers <ebiggers@google.com>
Tue, 13 Aug 2019 02:18:50 +0000 (19:18 -0700)
commit78a1b96bcf7a0721c7852bb1475218c3cbef884a
treec06a3abc722cba1df017467e0865c86671fb4ba8
parent23c688b54016eed15d39f4387ca9da241e165922
fscrypt: add FS_IOC_REMOVE_ENCRYPTION_KEY_ALL_USERS ioctl

Add a root-only variant of the FS_IOC_REMOVE_ENCRYPTION_KEY ioctl which
removes all users' claims of the key, not just the current user's claim.
I.e., it always removes the key itself, no matter how many users have
added it.

This is useful for forcing a directory to be locked, without having to
figure out which user ID(s) the key was added under.  This is planned to
be used by a command like 'sudo fscrypt lock DIR --all-users' in the
fscrypt userspace tool (http://github.com/google/fscrypt).

Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Eric Biggers <ebiggers@google.com>
fs/crypto/keyring.c
include/linux/fscrypt.h
include/uapi/linux/fscrypt.h