Skip to contentSkip to conversation

security/keys: remove possessor verify after key permission check

RFC PATCH Will Deacon 1 participant 1 message Apr 27, 2020 Keys/keyrings

lore
Share & tools
lore
#0 lore raw
Quoted 1 line · Алексей Красиков

ping

Hmm, did the original patch make it to the mailing list? I don't see it in the archives [1], so that might explain the silence.

Will

[1] https://www.spinics.net/lists/keyrings/maillist.html

Quoted 23 lines

"Alexey Krasikov" <[email protected]>:

In security/keys/keyctl.c: keyctl_read_key() after key_permission() check
is called is_key_possessed(). According to the current logic, if the caller is
a possessor, then it can read the key regardless of whether it has rights
to do so.

if I remove the possessor read rights:
    keyctl_setperm(key, KEY_POS_ALL & (~KEY_POS_SETATTR)); the calling process will still be able to read the key if it is possessor.

In other words, if the possessor doesn't have read rights, it doesn't matter.

---
I may be misunderstanding the logic behind it, but here's the patch to stir the discussion.