security/keys: remove possessor verify after key permission check
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()afterkey_permission()check
is calledis_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.Signed-off-by Alexey Krasikov <[1][email protected]>