linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] crypto: ecrdsa - use subsys_initcall instead of module_init
@ 2020-10-15 11:02 Tianjia Zhang
  2020-10-15 12:05 ` Herbert Xu
  0 siblings, 1 reply; 6+ messages in thread
From: Tianjia Zhang @ 2020-10-15 11:02 UTC (permalink / raw)
  To: Herbert Xu, David S. Miller, Vitaly Chikunov, linux-crypto, linux-kernel
  Cc: Tianjia Zhang

All templates and generic algorithms have been registered in
subsys_initcall instead of module_init. The ecrdsa algorithm
happened to be missed. Here is a fix for it.

Cc: Vitaly Chikunov <vt@altlinux.org>
Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
---
 crypto/ecrdsa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/ecrdsa.c b/crypto/ecrdsa.c
index 6a3fd09057d0..ca9a34356f80 100644
--- a/crypto/ecrdsa.c
+++ b/crypto/ecrdsa.c
@@ -288,7 +288,7 @@ static void __exit ecrdsa_mod_fini(void)
 	crypto_unregister_akcipher(&ecrdsa_alg);
 }
 
-module_init(ecrdsa_mod_init);
+subsys_initcall(ecrdsa_mod_init);
 module_exit(ecrdsa_mod_fini);
 
 MODULE_LICENSE("GPL");
-- 
2.19.1.3.ge56e4f7


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

* Re: [PATCH] crypto: ecrdsa - use subsys_initcall instead of module_init
  2020-10-15 11:02 [PATCH] crypto: ecrdsa - use subsys_initcall instead of module_init Tianjia Zhang
@ 2020-10-15 12:05 ` Herbert Xu
  2020-11-30  2:21   ` Tianjia Zhang
  0 siblings, 1 reply; 6+ messages in thread
From: Herbert Xu @ 2020-10-15 12:05 UTC (permalink / raw)
  To: Tianjia Zhang
  Cc: David S. Miller, Vitaly Chikunov, linux-crypto, linux-kernel

On Thu, Oct 15, 2020 at 07:02:41PM +0800, Tianjia Zhang wrote:
> All templates and generic algorithms have been registered in
> subsys_initcall instead of module_init. The ecrdsa algorithm
> happened to be missed. Here is a fix for it.

That is true only if there are non-generic implementations of
the algorithms, which is not the case here.  Please explain the
real reason why this is needed.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

* Re: [PATCH] crypto: ecrdsa - use subsys_initcall instead of module_init
  2020-10-15 12:05 ` Herbert Xu
@ 2020-11-30  2:21   ` Tianjia Zhang
  2020-11-30  2:24     ` Herbert Xu
  0 siblings, 1 reply; 6+ messages in thread
From: Tianjia Zhang @ 2020-11-30  2:21 UTC (permalink / raw)
  To: Herbert Xu, Vitaly Chikunov
  Cc: David S. Miller, Vitaly Chikunov, linux-crypto, linux-kernel

Hi Herbert,

On 10/15/20 8:05 PM, Herbert Xu wrote:
> On Thu, Oct 15, 2020 at 07:02:41PM +0800, Tianjia Zhang wrote:
>> All templates and generic algorithms have been registered in
>> subsys_initcall instead of module_init. The ecrdsa algorithm
>> happened to be missed. Here is a fix for it.
> 
> That is true only if there are non-generic implementations of
> the algorithms, which is not the case here.  Please explain the
> real reason why this is needed.
> 
> Cheers,
> 

This is a generic algorithm, the author Vitaly Chikunov has also 
confirmed it, please consider this patch again.

Thanks.

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

* Re: [PATCH] crypto: ecrdsa - use subsys_initcall instead of module_init
  2020-11-30  2:21   ` Tianjia Zhang
@ 2020-11-30  2:24     ` Herbert Xu
  2020-11-30  6:54       ` Tianjia Zhang
  0 siblings, 1 reply; 6+ messages in thread
From: Herbert Xu @ 2020-11-30  2:24 UTC (permalink / raw)
  To: Tianjia Zhang
  Cc: Vitaly Chikunov, David S. Miller, linux-crypto, linux-kernel

On Mon, Nov 30, 2020 at 10:21:56AM +0800, Tianjia Zhang wrote:
>
> > That is true only if there are non-generic implementations of
> > the algorithms, which is not the case here.  Please explain the
> > real reason why this is needed.
> 
> This is a generic algorithm, the author Vitaly Chikunov has also confirmed
> it, please consider this patch again.

As I said, the generic algorithm only needs to be loaded early *if*
there are non-generic implementations.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

* Re: [PATCH] crypto: ecrdsa - use subsys_initcall instead of module_init
  2020-11-30  2:24     ` Herbert Xu
@ 2020-11-30  6:54       ` Tianjia Zhang
  2020-12-01  8:37         ` Ard Biesheuvel
  0 siblings, 1 reply; 6+ messages in thread
From: Tianjia Zhang @ 2020-11-30  6:54 UTC (permalink / raw)
  To: Herbert Xu; +Cc: Vitaly Chikunov, David S. Miller, linux-crypto, linux-kernel



On 11/30/20 10:24 AM, Herbert Xu wrote:
> On Mon, Nov 30, 2020 at 10:21:56AM +0800, Tianjia Zhang wrote:
>>
>>> That is true only if there are non-generic implementations of
>>> the algorithms, which is not the case here.  Please explain the
>>> real reason why this is needed.
>>
>> This is a generic algorithm, the author Vitaly Chikunov has also confirmed
>> it, please consider this patch again.
> 
> As I said, the generic algorithm only needs to be loaded early *if*
> there are non-generic implementations.
> 
> Cheers,
> 

For ecrdsa, there is no reason to advance the initialization to 
subsys_init, this is just to make code clean up to have algorithm 
initialization uniform with other implementations.

It’s just that I think that in the commit c4741b230597 ("crypto: run 
initcalls for generic implementations earlier"), the modification to 
ecrdsa happened to be omitted, because from the point of commit time, it 
was submitted at the same time as the ecrdsa commits, and it may happen 
to be omitted for ecrdsa.

Best regards,
Tianjia

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

* Re: [PATCH] crypto: ecrdsa - use subsys_initcall instead of module_init
  2020-11-30  6:54       ` Tianjia Zhang
@ 2020-12-01  8:37         ` Ard Biesheuvel
  0 siblings, 0 replies; 6+ messages in thread
From: Ard Biesheuvel @ 2020-12-01  8:37 UTC (permalink / raw)
  To: Tianjia Zhang
  Cc: Herbert Xu, Vitaly Chikunov, David S. Miller,
	Linux Crypto Mailing List, Linux Kernel Mailing List

On Mon, 30 Nov 2020 at 07:58, Tianjia Zhang
<tianjia.zhang@linux.alibaba.com> wrote:
>
>
>
> On 11/30/20 10:24 AM, Herbert Xu wrote:
> > On Mon, Nov 30, 2020 at 10:21:56AM +0800, Tianjia Zhang wrote:
> >>
> >>> That is true only if there are non-generic implementations of
> >>> the algorithms, which is not the case here.  Please explain the
> >>> real reason why this is needed.
> >>
> >> This is a generic algorithm, the author Vitaly Chikunov has also confirmed
> >> it, please consider this patch again.
> >
> > As I said, the generic algorithm only needs to be loaded early *if*
> > there are non-generic implementations.
> >
> > Cheers,
> >
>
> For ecrdsa, there is no reason to advance the initialization to
> subsys_init, this is just to make code clean up to have algorithm
> initialization uniform with other implementations.
>
> It’s just that I think that in the commit c4741b230597 ("crypto: run
> initcalls for generic implementations earlier"), the modification to
> ecrdsa happened to be omitted, because from the point of commit time, it
> was submitted at the same time as the ecrdsa commits, and it may happen
> to be omitted for ecrdsa.
>

Whether or not it is a generic algorithm is irrelevant.

What is relevant is whether any other implementations exist of the
same algorithm, because in this case, the generic implementation must
be available earlier, so that it can be used for testing the other
implementation.

This concern does not apply for ecrdsa, so this patch is unnecessary.

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

end of thread, other threads:[~2020-12-01  8:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-15 11:02 [PATCH] crypto: ecrdsa - use subsys_initcall instead of module_init Tianjia Zhang
2020-10-15 12:05 ` Herbert Xu
2020-11-30  2:21   ` Tianjia Zhang
2020-11-30  2:24     ` Herbert Xu
2020-11-30  6:54       ` Tianjia Zhang
2020-12-01  8:37         ` Ard Biesheuvel

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