X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=security%2Fkeys%2Fkeyring.c;h=2fb2576dc6448b3c1020dc311e0d81bfe77fb768;hb=084c6c5013af3c62f1c344435214496f5ac999f2;hp=d46cbc5e335e9c330ccd74a08fcbf78aeafe8c96;hpb=6dd9158ae8577372aa433e6b0eae3c3d4caa5439;p=~andy%2Flinux diff --git a/security/keys/keyring.c b/security/keys/keyring.c index d46cbc5e335..2fb2576dc64 100644 --- a/security/keys/keyring.c +++ b/security/keys/keyring.c @@ -1000,7 +1000,11 @@ static int keyring_detect_cycle_iterator(const void *object, kenter("{%d}", key->serial); - BUG_ON(key != ctx->match_data); + /* We might get a keyring with matching index-key that is nonetheless a + * different keyring. */ + if (key != ctx->match_data) + return 0; + ctx->result = ERR_PTR(-EDEADLK); return 1; }