keys: Fix unreachable code
Subsystems (2)
David Howells
maintainerPATCH 1/2 keys: Fix unreachable code
From: Alan Cox <[email protected]>
We set ret to NULL then test it. Remove the bogus test
Signed-off-by Alan Cox <[email protected]>
Signed-off-by David Howells <[email protected]>
---
security/keys/process_keys.c | 2 -- 1 file changed, 2 deletions(-)
security/keys/process_keys.c +0 -2
@@ -367,8 +367,6 @@ key_ref_t search_my_process_keyrings(struct key_type *type,switch (PTR_ERR (key_ref)) {case -EAGAIN :/* no key */ -if (ret) -break ;case -ENOKEY :/* negative key */ ret = key_ref;break ;
David Howells
maintainerPATCH 2/2 KEYS: Use keyring_alloc() to create module signing keyring
Use keyring_alloc() to create special keyrings now that it has a permissions parameter rather than using key_alloc() + key_instantiate_and_link().
Signed-off-by David Howells <[email protected]>
cc Rusty Russell <[email protected]>
---
kernel/modsign_pubkey.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)
kernel/modsign_pubkey.c +6 -9
@@ -40,18 +40,15 @@ static __init int module_verify_init(void) {pr_notice ("Initialise module verification\n" ); - modsign_keyring =key_alloc (&key_type_keyring,".module_sign" , -KUIDT_INIT (0 ),KGIDT_INIT (0 ), -current_cred (), - (KEY_POS_ALL & ~KEY_POS_SETATTR ) | -KEY_USR_VIEW |KEY_USR_READ , -KEY_ALLOC_NOT_IN_QUOTA ); + modsign_keyring =keyring_alloc (".module_sign" , +KUIDT_INIT (0 ),KGIDT_INIT (0 ), +current_cred (), + ((KEY_POS_ALL & ~KEY_POS_SETATTR ) | +KEY_USR_VIEW |KEY_USR_READ ), +KEY_ALLOC_NOT_IN_QUOTA ,NULL );if (IS_ERR (modsign_keyring))panic ("Can't allocate module signing keyring\n" ); -if (key_instantiate_and_link (modsign_keyring,NULL ,0 ,NULL ,NULL ) <0 ) -panic ("Can't instantiate module signing keyring\n" ); -return 0 ; }