Message ID | 20230313221231.272498-4-ebiggers@kernel.org (mailing list archive) |
---|---|
State | Mainlined, archived |
Headers | show |
Series | Fix crash with fscrypt + Landlock | expand |
diff --git a/fs/crypto/keyring.c b/fs/crypto/keyring.c index bb15709ac9a40..13d336a6cc5da 100644 --- a/fs/crypto/keyring.c +++ b/fs/crypto/keyring.c @@ -92,6 +92,8 @@ void fscrypt_put_master_key_activeref(struct super_block *sb, * destroying any subkeys embedded in it. */ + if (WARN_ON(!sb->s_master_keys)) + return; spin_lock(&sb->s_master_keys->lock); hlist_del_rcu(&mk->mk_node); spin_unlock(&sb->s_master_keys->lock);