[v2] modsign: use all trusted keys to verify module signature
diff mbox series

Message ID 20181106232130.33932-1-mikewu@google.com
State Accepted
Commit e84cd7ee630e44a2cc8ae49e85920a271b214cb3
Headers show
Series
  • [v2] modsign: use all trusted keys to verify module signature
Related show

Commit Message

Ke Wu Nov. 6, 2018, 11:21 p.m. UTC
Make mod_verify_sig to use all trusted keys. This allows keys in
secondary_trusted_keys to be used to verify PKCS#7 signature on a
kernel module.

Signed-off-by: Ke Wu <mikewu@google.com>
---
Changelog since v1:
- Use VERIFY_USE_SECONDARY_KEYRING rather than (void *)1UL

 kernel/module_signing.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Ke Wu Nov. 6, 2018, 11:23 p.m. UTC | #1
Thanks for the comment! I switched to use
VERIFY_USE_SECONDARY_KEYRING, please take a look.

On Tue, Nov 6, 2018 at 3:21 PM Ke Wu <mikewu@google.com> wrote:
>
> Make mod_verify_sig to use all trusted keys. This allows keys in
> secondary_trusted_keys to be used to verify PKCS#7 signature on a
> kernel module.
>
> Signed-off-by: Ke Wu <mikewu@google.com>
> ---
> Changelog since v1:
> - Use VERIFY_USE_SECONDARY_KEYRING rather than (void *)1UL
>
>  kernel/module_signing.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/module_signing.c b/kernel/module_signing.c
> index f2075ce8e4b3..6b9a926fd86b 100644
> --- a/kernel/module_signing.c
> +++ b/kernel/module_signing.c
> @@ -83,6 +83,7 @@ int mod_verify_sig(const void *mod, struct load_info *info)
>         }
>
>         return verify_pkcs7_signature(mod, modlen, mod + modlen, sig_len,
> -                                     NULL, VERIFYING_MODULE_SIGNATURE,
> +                                     VERIFY_USE_SECONDARY_KEYRING,
> +                                     VERIFYING_MODULE_SIGNATURE,
>                                       NULL, NULL);
>  }
> --
> 2.19.1.930.g4563a0d9d0-goog
>
Jessica Yu Nov. 7, 2018, 2:37 p.m. UTC | #2
+++ Ke Wu [06/11/18 15:23 -0800]:
>Thanks for the comment! I switched to use
>VERIFY_USE_SECONDARY_KEYRING, please take a look.

Patch has been queued on modules-next. Thanks!

Jessica

>On Tue, Nov 6, 2018 at 3:21 PM Ke Wu <mikewu@google.com> wrote:
>>
>> Make mod_verify_sig to use all trusted keys. This allows keys in
>> secondary_trusted_keys to be used to verify PKCS#7 signature on a
>> kernel module.
>>
>> Signed-off-by: Ke Wu <mikewu@google.com>
>> ---
>> Changelog since v1:
>> - Use VERIFY_USE_SECONDARY_KEYRING rather than (void *)1UL
>>
>>  kernel/module_signing.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/kernel/module_signing.c b/kernel/module_signing.c
>> index f2075ce8e4b3..6b9a926fd86b 100644
>> --- a/kernel/module_signing.c
>> +++ b/kernel/module_signing.c
>> @@ -83,6 +83,7 @@ int mod_verify_sig(const void *mod, struct load_info *info)
>>         }
>>
>>         return verify_pkcs7_signature(mod, modlen, mod + modlen, sig_len,
>> -                                     NULL, VERIFYING_MODULE_SIGNATURE,
>> +                                     VERIFY_USE_SECONDARY_KEYRING,
>> +                                     VERIFYING_MODULE_SIGNATURE,
>>                                       NULL, NULL);
>>  }
>> --
>> 2.19.1.930.g4563a0d9d0-goog
>>
>
>
>-- 
>Ke Wu | Software Engineer | mikewu@google.com | Google Inc.

Patch
diff mbox series

diff --git a/kernel/module_signing.c b/kernel/module_signing.c
index f2075ce8e4b3..6b9a926fd86b 100644
--- a/kernel/module_signing.c
+++ b/kernel/module_signing.c
@@ -83,6 +83,7 @@  int mod_verify_sig(const void *mod, struct load_info *info)
 	}
 
 	return verify_pkcs7_signature(mod, modlen, mod + modlen, sig_len,
-				      NULL, VERIFYING_MODULE_SIGNATURE,
+				      VERIFY_USE_SECONDARY_KEYRING,
+				      VERIFYING_MODULE_SIGNATURE,
 				      NULL, NULL);
 }