linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] modsign: use all trusted keys to verify module signature
@ 2018-10-22 22:26 Ke Wu
  2018-10-30 19:11 ` Ke Wu
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Ke Wu @ 2018-10-22 22:26 UTC (permalink / raw)
  To: Jessica Yu, David Howells; +Cc: Ke Wu, linux-kernel

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>
---
 kernel/module_signing.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/module_signing.c b/kernel/module_signing.c
index f2075ce8e4b3..a8b923ba1a39 100644
--- a/kernel/module_signing.c
+++ b/kernel/module_signing.c
@@ -83,6 +83,6 @@ 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,
+				      (void *)1UL, VERIFYING_MODULE_SIGNATURE,
 				      NULL, NULL);
 }
-- 
2.19.1.568.g152ad8e336-goog


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] modsign: use all trusted keys to verify module signature
  2018-10-22 22:26 [PATCH] modsign: use all trusted keys to verify module signature Ke Wu
@ 2018-10-30 19:11 ` Ke Wu
  2018-10-31  9:36 ` Jessica Yu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Ke Wu @ 2018-10-30 19:11 UTC (permalink / raw)
  To: jeyu, dhowells; +Cc: linux-kernel

Friendly ping.

On Mon, Oct 22, 2018 at 3:26 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>
> ---
>  kernel/module_signing.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/module_signing.c b/kernel/module_signing.c
> index f2075ce8e4b3..a8b923ba1a39 100644
> --- a/kernel/module_signing.c
> +++ b/kernel/module_signing.c
> @@ -83,6 +83,6 @@ 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,
> +                                     (void *)1UL, VERIFYING_MODULE_SIGNATURE,
>                                       NULL, NULL);
>  }
> --
> 2.19.1.568.g152ad8e336-goog
>


-- 
Ke Wu | Software Engineer | mikewu@google.com | Google Inc.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] modsign: use all trusted keys to verify module signature
  2018-10-22 22:26 [PATCH] modsign: use all trusted keys to verify module signature Ke Wu
  2018-10-30 19:11 ` Ke Wu
@ 2018-10-31  9:36 ` Jessica Yu
  2018-11-05 19:13   ` Ke Wu
  2018-11-06 12:35 ` Jessica Yu
  2018-11-06 23:21 ` [PATCH v2] " Ke Wu
  3 siblings, 1 reply; 8+ messages in thread
From: Jessica Yu @ 2018-10-31  9:36 UTC (permalink / raw)
  To: Ke Wu; +Cc: David Howells, linux-kernel

+++ Ke Wu [22/10/18 15:26 -0700]:
>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>

Thanks for the ping, I had missed this patch.

David, could I get an ACK please?

Thanks!

Jessica

>---
> kernel/module_signing.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/kernel/module_signing.c b/kernel/module_signing.c
>index f2075ce8e4b3..a8b923ba1a39 100644
>--- a/kernel/module_signing.c
>+++ b/kernel/module_signing.c
>@@ -83,6 +83,6 @@ 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,
>+				      (void *)1UL, VERIFYING_MODULE_SIGNATURE,
> 				      NULL, NULL);
> }
>-- 
>2.19.1.568.g152ad8e336-goog
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] modsign: use all trusted keys to verify module signature
  2018-10-31  9:36 ` Jessica Yu
@ 2018-11-05 19:13   ` Ke Wu
  0 siblings, 0 replies; 8+ messages in thread
From: Ke Wu @ 2018-11-05 19:13 UTC (permalink / raw)
  To: jeyu; +Cc: dhowells, linux-kernel

Hi, I'm wondering if there is any update for the patch.

Thanks!

On Wed, Oct 31, 2018 at 2:36 AM Jessica Yu <jeyu@kernel.org> wrote:
>
> +++ Ke Wu [22/10/18 15:26 -0700]:
> >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>
>
> Thanks for the ping, I had missed this patch.
>
> David, could I get an ACK please?
>
> Thanks!
>
> Jessica
>
> >---
> > kernel/module_signing.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> >diff --git a/kernel/module_signing.c b/kernel/module_signing.c
> >index f2075ce8e4b3..a8b923ba1a39 100644
> >--- a/kernel/module_signing.c
> >+++ b/kernel/module_signing.c
> >@@ -83,6 +83,6 @@ 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,
> >+                                    (void *)1UL, VERIFYING_MODULE_SIGNATURE,
> >                                     NULL, NULL);
> > }
> >--
> >2.19.1.568.g152ad8e336-goog
> >



-- 
Ke Wu | Software Engineer | mikewu@google.com | Google Inc.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] modsign: use all trusted keys to verify module signature
  2018-10-22 22:26 [PATCH] modsign: use all trusted keys to verify module signature Ke Wu
  2018-10-30 19:11 ` Ke Wu
  2018-10-31  9:36 ` Jessica Yu
@ 2018-11-06 12:35 ` Jessica Yu
  2018-11-06 23:21 ` [PATCH v2] " Ke Wu
  3 siblings, 0 replies; 8+ messages in thread
From: Jessica Yu @ 2018-11-06 12:35 UTC (permalink / raw)
  To: Ke Wu; +Cc: David Howells, linux-kernel

+++ Ke Wu [22/10/18 15:26 -0700]:
>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>
>---
> kernel/module_signing.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/kernel/module_signing.c b/kernel/module_signing.c
>index f2075ce8e4b3..a8b923ba1a39 100644
>--- a/kernel/module_signing.c
>+++ b/kernel/module_signing.c
>@@ -83,6 +83,6 @@ 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,
>+				      (void *)1UL, VERIFYING_MODULE_SIGNATURE,
> 				      NULL, NULL);
> }

I've just stumbled on commit 817aef260037f ("Replace magic for trusting
the secondary keyring with #define"), so we should probably use
VERIFY_USE_SECONDARY_KEYRING in place of (void *)1UL.

Thanks,

Jessica

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2] modsign: use all trusted keys to verify module signature
  2018-10-22 22:26 [PATCH] modsign: use all trusted keys to verify module signature Ke Wu
                   ` (2 preceding siblings ...)
  2018-11-06 12:35 ` Jessica Yu
@ 2018-11-06 23:21 ` Ke Wu
  2018-11-06 23:23   ` Ke Wu
  3 siblings, 1 reply; 8+ messages in thread
From: Ke Wu @ 2018-11-06 23:21 UTC (permalink / raw)
  To: Jessica Yu, David Howells; +Cc: Ke Wu, linux-kernel

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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] modsign: use all trusted keys to verify module signature
  2018-11-06 23:21 ` [PATCH v2] " Ke Wu
@ 2018-11-06 23:23   ` Ke Wu
  2018-11-07 14:37     ` Jessica Yu
  0 siblings, 1 reply; 8+ messages in thread
From: Ke Wu @ 2018-11-06 23:23 UTC (permalink / raw)
  To: jeyu, dhowells; +Cc: linux-kernel

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
>


-- 
Ke Wu | Software Engineer | mikewu@google.com | Google Inc.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] modsign: use all trusted keys to verify module signature
  2018-11-06 23:23   ` Ke Wu
@ 2018-11-07 14:37     ` Jessica Yu
  0 siblings, 0 replies; 8+ messages in thread
From: Jessica Yu @ 2018-11-07 14:37 UTC (permalink / raw)
  To: Ke Wu; +Cc: dhowells, linux-kernel

+++ 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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-11-07 14:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-22 22:26 [PATCH] modsign: use all trusted keys to verify module signature Ke Wu
2018-10-30 19:11 ` Ke Wu
2018-10-31  9:36 ` Jessica Yu
2018-11-05 19:13   ` Ke Wu
2018-11-06 12:35 ` Jessica Yu
2018-11-06 23:21 ` [PATCH v2] " Ke Wu
2018-11-06 23:23   ` Ke Wu
2018-11-07 14:37     ` Jessica Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).