Thread (51 messages) 51 messages, 6 authors, 2019-08-12

Re: [PATCH v7 11/16] fscrypt: allow unprivileged users to add/remove keys for v2 policies

From: "Theodore Y. Ts'o" <tytso@mit.edu>
Date: 2019-07-28 21:22:51
Also in: keyrings, linux-crypto, linux-ext4, linux-f2fs-devel, linux-fscrypt, linux-fsdevel

On Fri, Jul 26, 2019 at 03:41:36PM -0700, Eric Biggers wrote:
quoted hunk ↗ jump to hunk
diff --git a/fs/crypto/keyring.c b/fs/crypto/keyring.c
index 56e085c2ed8c6..307533d4d7c51 100644
--- a/fs/crypto/keyring.c
+++ b/fs/crypto/keyring.c
+		if (mk->mk_users->keys.nr_leaves_on_tree != 0) {
+			/*
+			 * Other users have still added the key too.  We removed
+			 * the current user's usage of the key if there was one,
+			 * but we still can't remove the key itself.
+			 */
+			err = -EUSERS;
+			up_write(&key->sem);
+			goto out_put_key;
I commented about this on an earlier patch, but I'm not convinced we
should be returning EUSERS here.  Returning success might be a better
choice.

					- Ted

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help