Skip to content

Commit fe9453a

Browse files
dhowellstorvalds
authored andcommitted
KEYS: Revert one application of "Fix unreachable code" patch
A patch to fix some unreachable code in search_my_process_keyrings() got applied twice by two different routes upstream as commits e67eab3 and b010520 (both "fix unreachable code"). Unfortunately, the second application removed something it shouldn't have and this wasn't detected by GIT. This is due to the patch not having sufficient lines of context to distinguish the two places of application. The effect of this is relatively minor: inside the kernel, the keyring search routines may search multiple keyrings and then prioritise the errors if no keys or negative keys are found in any of them. With the extra deletion, the presence of a negative key in the thread keyring (causing ENOKEY) is incorrectly overridden by an error searching the process keyring. So revert the second application of the patch. Signed-off-by: David Howells <dhowells@redhat.com> Cc: Jiri Kosina <jkosina@suse.cz> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: stable@vger.kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent a0b1c42 commit fe9453a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

security/keys/process_keys.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,8 @@ key_ref_t search_my_process_keyrings(struct key_type *type,
367367

368368
switch (PTR_ERR(key_ref)) {
369369
case -EAGAIN: /* no key */
370+
if (ret)
371+
break;
370372
case -ENOKEY: /* negative key */
371373
ret = key_ref;
372374
break;

0 commit comments

Comments
 (0)