public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH stable v5.15.y 0/1] crypto: add __init/__exit annotations to init/exit funcs
@ 2023-02-14 19:52 Saeed Mirzamohammadi
  2023-02-14 19:53 ` [PATCH stable v5.15.y 1/1] " Saeed Mirzamohammadi
  0 siblings, 1 reply; 5+ messages in thread
From: Saeed Mirzamohammadi @ 2023-02-14 19:52 UTC (permalink / raw)
  To: stable
  Cc: saeed.mirzamohammadi, Dan Williams, Herbert Xu, David S. Miller,
	Xiu Jianfeng, linux-crypto, linux-kernel

Add missing patch in stable v5.15.y that fixes missing __init/__exit
macros for crypto algorithms.

Commit Data:
  commit-id        : 33837be33367172d66d1f2bd6964cc41448e6e7c
  subject          : crypto: add __init/__exit annotations to init/exit funcs
  author           : xiujianfeng@huawei.com
  author date      : 2022-09-15 03:36:15

Xiu Jianfeng (1):
  crypto: add __init/__exit annotations to init/exit funcs

 crypto/async_tx/raid6test.c | 4 ++--
 crypto/curve25519-generic.c | 4 ++--
 crypto/dh.c                 | 4 ++--
 crypto/ecdh.c               | 4 ++--
 crypto/ecdsa.c              | 4 ++--
 crypto/rsa.c                | 4 ++--
 crypto/sm2.c                | 4 ++--
 7 files changed, 14 insertions(+), 14 deletions(-)

-- 
2.39.1


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

* [PATCH stable v5.15.y 1/1] crypto: add __init/__exit annotations to init/exit funcs
  2023-02-14 19:52 [PATCH stable v5.15.y 0/1] crypto: add __init/__exit annotations to init/exit funcs Saeed Mirzamohammadi
@ 2023-02-14 19:53 ` Saeed Mirzamohammadi
  2023-02-15  6:55   ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Saeed Mirzamohammadi @ 2023-02-14 19:53 UTC (permalink / raw)
  To: stable
  Cc: saeed.mirzamohammadi, Xiu Jianfeng, Herbert Xu, Dan Williams,
	David S. Miller, linux-crypto, linux-kernel

From: Xiu Jianfeng <xiujianfeng@huawei.com>

Add missing __init/__exit annotations to init/exit funcs.

Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit 33837be33367172d66d1f2bd6964cc41448e6e7c)
Cc: stable@vger.kernel.org # 5.15+
Signed-off-by: Saeed Mirzamohammadi <saeed.mirzamohammadi@oracle.com>
---
 crypto/async_tx/raid6test.c | 4 ++--
 crypto/curve25519-generic.c | 4 ++--
 crypto/dh.c                 | 4 ++--
 crypto/ecdh.c               | 4 ++--
 crypto/ecdsa.c              | 4 ++--
 crypto/rsa.c                | 4 ++--
 crypto/sm2.c                | 4 ++--
 7 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/crypto/async_tx/raid6test.c b/crypto/async_tx/raid6test.c
index 66db82e5a3b13..1e413033449b3 100644
--- a/crypto/async_tx/raid6test.c
+++ b/crypto/async_tx/raid6test.c
@@ -189,7 +189,7 @@ static int test(int disks, int *tests)
 }
 
 
-static int raid6_test(void)
+static int __init raid6_test(void)
 {
 	int err = 0;
 	int tests = 0;
@@ -236,7 +236,7 @@ static int raid6_test(void)
 	return 0;
 }
 
-static void raid6_test_exit(void)
+static void __exit raid6_test_exit(void)
 {
 }
 
diff --git a/crypto/curve25519-generic.c b/crypto/curve25519-generic.c
index bd88fd571393d..d055b0784c77c 100644
--- a/crypto/curve25519-generic.c
+++ b/crypto/curve25519-generic.c
@@ -72,12 +72,12 @@ static struct kpp_alg curve25519_alg = {
 	.max_size		= curve25519_max_size,
 };
 
-static int curve25519_init(void)
+static int __init curve25519_init(void)
 {
 	return crypto_register_kpp(&curve25519_alg);
 }
 
-static void curve25519_exit(void)
+static void __exit curve25519_exit(void)
 {
 	crypto_unregister_kpp(&curve25519_alg);
 }
diff --git a/crypto/dh.c b/crypto/dh.c
index cd4f32092e5ce..dec4c16cb12a2 100644
--- a/crypto/dh.c
+++ b/crypto/dh.c
@@ -260,12 +260,12 @@ static struct kpp_alg dh = {
 	},
 };
 
-static int dh_init(void)
+static int __init dh_init(void)
 {
 	return crypto_register_kpp(&dh);
 }
 
-static void dh_exit(void)
+static void __exit dh_exit(void)
 {
 	crypto_unregister_kpp(&dh);
 }
diff --git a/crypto/ecdh.c b/crypto/ecdh.c
index c6f61c2211dc7..fe8966511e9d7 100644
--- a/crypto/ecdh.c
+++ b/crypto/ecdh.c
@@ -200,7 +200,7 @@ static struct kpp_alg ecdh_nist_p384 = {
 
 static bool ecdh_nist_p192_registered;
 
-static int ecdh_init(void)
+static int __init ecdh_init(void)
 {
 	int ret;
 
@@ -227,7 +227,7 @@ static int ecdh_init(void)
 	return ret;
 }
 
-static void ecdh_exit(void)
+static void __exit ecdh_exit(void)
 {
 	if (ecdh_nist_p192_registered)
 		crypto_unregister_kpp(&ecdh_nist_p192);
diff --git a/crypto/ecdsa.c b/crypto/ecdsa.c
index 1e7b15009bf63..9dd8d977caaed 100644
--- a/crypto/ecdsa.c
+++ b/crypto/ecdsa.c
@@ -332,7 +332,7 @@ static struct akcipher_alg ecdsa_nist_p192 = {
 };
 static bool ecdsa_nist_p192_registered;
 
-static int ecdsa_init(void)
+static int __init ecdsa_init(void)
 {
 	int ret;
 
@@ -359,7 +359,7 @@ static int ecdsa_init(void)
 	return ret;
 }
 
-static void ecdsa_exit(void)
+static void __exit ecdsa_exit(void)
 {
 	if (ecdsa_nist_p192_registered)
 		crypto_unregister_akcipher(&ecdsa_nist_p192);
diff --git a/crypto/rsa.c b/crypto/rsa.c
index 4cdbec95d0779..37a8e629af2dc 100644
--- a/crypto/rsa.c
+++ b/crypto/rsa.c
@@ -255,7 +255,7 @@ static struct akcipher_alg rsa = {
 	},
 };
 
-static int rsa_init(void)
+static int __init rsa_init(void)
 {
 	int err;
 
@@ -272,7 +272,7 @@ static int rsa_init(void)
 	return 0;
 }
 
-static void rsa_exit(void)
+static void __exit rsa_exit(void)
 {
 	crypto_unregister_template(&rsa_pkcs1pad_tmpl);
 	crypto_unregister_akcipher(&rsa);
diff --git a/crypto/sm2.c b/crypto/sm2.c
index db8a4a265669d..a1d86a96d88b1 100644
--- a/crypto/sm2.c
+++ b/crypto/sm2.c
@@ -441,12 +441,12 @@ static struct akcipher_alg sm2 = {
 	},
 };
 
-static int sm2_init(void)
+static int __init sm2_init(void)
 {
 	return crypto_register_akcipher(&sm2);
 }
 
-static void sm2_exit(void)
+static void __exit sm2_exit(void)
 {
 	crypto_unregister_akcipher(&sm2);
 }
-- 
2.39.1


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

* Re: [PATCH stable v5.15.y 1/1] crypto: add __init/__exit annotations to init/exit funcs
  2023-02-14 19:53 ` [PATCH stable v5.15.y 1/1] " Saeed Mirzamohammadi
@ 2023-02-15  6:55   ` Greg KH
  2023-02-15 23:10     ` Saeed Mirzamohammadi
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2023-02-15  6:55 UTC (permalink / raw)
  To: Saeed Mirzamohammadi
  Cc: stable, Xiu Jianfeng, Herbert Xu, Dan Williams, David S. Miller,
	linux-crypto, linux-kernel

On Tue, Feb 14, 2023 at 11:53:00AM -0800, Saeed Mirzamohammadi wrote:
> From: Xiu Jianfeng <xiujianfeng@huawei.com>
> 
> Add missing __init/__exit annotations to init/exit funcs.
> 
> Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
> (cherry picked from commit 33837be33367172d66d1f2bd6964cc41448e6e7c)
> Cc: stable@vger.kernel.org # 5.15+
> Signed-off-by: Saeed Mirzamohammadi <saeed.mirzamohammadi@oracle.com>
> ---
>  crypto/async_tx/raid6test.c | 4 ++--
>  crypto/curve25519-generic.c | 4 ++--
>  crypto/dh.c                 | 4 ++--
>  crypto/ecdh.c               | 4 ++--
>  crypto/ecdsa.c              | 4 ++--
>  crypto/rsa.c                | 4 ++--
>  crypto/sm2.c                | 4 ++--
>  7 files changed, 14 insertions(+), 14 deletions(-)

What bug/problem does this resolve?  Why is this needed in stable
kernels?

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

* Re: [PATCH stable v5.15.y 1/1] crypto: add __init/__exit annotations to init/exit funcs
  2023-02-15  6:55   ` Greg KH
@ 2023-02-15 23:10     ` Saeed Mirzamohammadi
  2023-02-16  6:58       ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Saeed Mirzamohammadi @ 2023-02-15 23:10 UTC (permalink / raw)
  To: Greg KH
  Cc: # v4 . 16+, Xiu Jianfeng, Herbert Xu, Dan Williams,
	David S. Miller, linux-crypto@vger.kernel.org,
	linux-kernel@vger.kernel.org

Hi,

> On Feb 14, 2023, at 10:55 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> 
> On Tue, Feb 14, 2023 at 11:53:00AM -0800, Saeed Mirzamohammadi wrote:
>> From: Xiu Jianfeng <xiujianfeng@huawei.com>
>> 
>> Add missing __init/__exit annotations to init/exit funcs.
>> 
>> Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
>> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
>> (cherry picked from commit 33837be33367172d66d1f2bd6964cc41448e6e7c)
>> Cc: stable@vger.kernel.org # 5.15+
>> Signed-off-by: Saeed Mirzamohammadi <saeed.mirzamohammadi@oracle.com>
>> ---
>> crypto/async_tx/raid6test.c | 4 ++--
>> crypto/curve25519-generic.c | 4 ++--
>> crypto/dh.c                 | 4 ++--
>> crypto/ecdh.c               | 4 ++--
>> crypto/ecdsa.c              | 4 ++--
>> crypto/rsa.c                | 4 ++--
>> crypto/sm2.c                | 4 ++--
>> 7 files changed, 14 insertions(+), 14 deletions(-)
> 
> What bug/problem does this resolve?  Why is this needed in stable
> kernels?

I don’t have any specific bug to discuss for this fix. It would help freeing up some memory after initialization for these crypto modules since the init function is only called once but not addressing any major issue. Feel free to disregard if this is trivial for stable.

Thanks,
Saeed

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

* Re: [PATCH stable v5.15.y 1/1] crypto: add __init/__exit annotations to init/exit funcs
  2023-02-15 23:10     ` Saeed Mirzamohammadi
@ 2023-02-16  6:58       ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2023-02-16  6:58 UTC (permalink / raw)
  To: Saeed Mirzamohammadi
  Cc: # v4 . 16+, Xiu Jianfeng, Herbert Xu, Dan Williams,
	David S. Miller, linux-crypto@vger.kernel.org,
	linux-kernel@vger.kernel.org

On Wed, Feb 15, 2023 at 11:10:14PM +0000, Saeed Mirzamohammadi wrote:
> Hi,
> 
> > On Feb 14, 2023, at 10:55 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> > 
> > On Tue, Feb 14, 2023 at 11:53:00AM -0800, Saeed Mirzamohammadi wrote:
> >> From: Xiu Jianfeng <xiujianfeng@huawei.com>
> >> 
> >> Add missing __init/__exit annotations to init/exit funcs.
> >> 
> >> Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
> >> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
> >> (cherry picked from commit 33837be33367172d66d1f2bd6964cc41448e6e7c)
> >> Cc: stable@vger.kernel.org # 5.15+
> >> Signed-off-by: Saeed Mirzamohammadi <saeed.mirzamohammadi@oracle.com>
> >> ---
> >> crypto/async_tx/raid6test.c | 4 ++--
> >> crypto/curve25519-generic.c | 4 ++--
> >> crypto/dh.c                 | 4 ++--
> >> crypto/ecdh.c               | 4 ++--
> >> crypto/ecdsa.c              | 4 ++--
> >> crypto/rsa.c                | 4 ++--
> >> crypto/sm2.c                | 4 ++--
> >> 7 files changed, 14 insertions(+), 14 deletions(-)
> > 
> > What bug/problem does this resolve?  Why is this needed in stable
> > kernels?
> 
> I don’t have any specific bug to discuss for this fix. It would help freeing up some memory after initialization for these crypto modules since the init function is only called once but not addressing any major issue. Feel free to disregard if this is trivial for stable.

Exactly how much memory is actually freed here and why is that required
for a stable kernel?

Please read the kernel documentation for what is considered a valid
stable kernel change:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html

thanks,

greg k-h

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

end of thread, other threads:[~2023-02-16  6:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-14 19:52 [PATCH stable v5.15.y 0/1] crypto: add __init/__exit annotations to init/exit funcs Saeed Mirzamohammadi
2023-02-14 19:53 ` [PATCH stable v5.15.y 1/1] " Saeed Mirzamohammadi
2023-02-15  6:55   ` Greg KH
2023-02-15 23:10     ` Saeed Mirzamohammadi
2023-02-16  6:58       ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox