KEYS: fix compilation warnings in the dump_options() function
Subsystems (5)
PATCH 1/1 KEYS: fix compilation warnings in the dump_options() function
From: Ye Bin <[email protected]>
There's issue as follows:security/keys/trusted-keys/trusted_caam.c: In function ‘dump_options’:security/keys/trusted-keys/trusted_caam.c:37:20: note: the ABI of passing struct with a flexible array member has changed in GCC 4.4
37 | static inline void dump_options(struct caam_pkey_info pkey_info)
| ^~~~~~~~~~~~
To solve the above problem, pass 'struct caam_pkey_info*' type parameter to the dump_options() function.
--- security/keys/trusted-keys/trusted_caam.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
security/keys/trusted-keys/trusted_caam.c +5 -5
@@ -29,12 +29,12 @@ static const match_table_t key_tokens = { };#ifdef CAAM_DEBUG -static inline void dump_options (struct caam_pkey_info pkey_info) +static inline void dump_options (struct caam_pkey_info *pkey_info) { -pr_info ("key encryption algo %d\n" , pkey_info.key_enc_algo); +pr_info ("key encryption algo %d\n" , pkey_info->key_enc_algo); }#else -static inline void dump_options (struct caam_pkey_info pkey_info) +static inline void dump_options (struct caam_pkey_info *pkey_info) { }#endif
@@ -108,7 +108,7 @@ static int trusted_caam_seal(struct trusted_key_payload *p, char *datablob) ret =get_pkey_options (datablob, &info.pkey_info);if (ret <0 )return 0 ; -dump_options (info.pkey_info); +dump_options (&info.pkey_info); } ret =caam_encap_blob (blobifier, &info);
@@ -140,7 +140,7 @@ static int trusted_caam_unseal(struct trusted_key_payload *p, char *datablob) ret =get_pkey_options (datablob, &info.pkey_info);if (ret <0 )return 0 ; -dump_options (info.pkey_info); +dump_options (&info.pkey_info); p->key_len = p->blob_len +sizeof (struct caam_pkey_info );memcpy (p->key, &info.pkey_info,sizeof (struct caam_pkey_info ));
Signature · 1 line
2.34.1
Ignore this patch as 275a9a3f9b6a(“KEYS: trusted: Pass argument by pointer in dump_options”)already fix this issue.
Quoted 56 lines · Ye Bin
From: Ye Bin <[email protected]>
There's issue as follows:
security/keys/trusted-keys/trusted_caam.c: In function ‘dump_options’:security/keys/trusted-keys/trusted_caam.c:37:20: note: the ABI of passing struct with a flexible array member has changed in GCC 4.4
37 | static inline voiddump_options(struct caam_pkey_info pkey_info)
| ^~~~~~~~~~~~To solve the above problem, pass 'struct caam_pkey_info*' type parameter to the
dump_options()function.Fixes 9eb25ca6c973 ("KEYS: trusted: caam based protected key")Signed-off-by Ye Bin <[email protected]>--- security/keys/trusted-keys/trusted_caam.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)security/keys/trusted-keys/trusted_caam.c +5
-5@@ -29,12 +29,12 @@ static const match_table_t key_tokens = { };#ifdef CAAM_DEBUG -static inline void dump_options (struct caam_pkey_info pkey_info) +static inline void dump_options (struct caam_pkey_info *pkey_info) { -pr_info ("key encryption algo %d\n" , pkey_info.key_enc_algo); +pr_info ("key encryption algo %d\n" , pkey_info->key_enc_algo); }#else -static inline void dump_options (struct caam_pkey_info pkey_info) +static inline void dump_options (struct caam_pkey_info *pkey_info) { }#endif @@ -108,7 +108,7 @@ static int trusted_caam_seal(struct trusted_key_payload *p, char *datablob) ret =get_pkey_options (datablob, &info.pkey_info);if (ret <0 )return 0 ; -dump_options (info.pkey_info); +dump_options (&info.pkey_info); } ret =caam_encap_blob (blobifier, &info);@@ -140,7 +140,7 @@ static int trusted_caam_unseal(struct trusted_key_payload *p, char *datablob) ret =get_pkey_options (datablob, &info.pkey_info);if (ret <0 )return 0 ; -dump_options (info.pkey_info); +dump_options (&info.pkey_info); p->key_len = p->blob_len +sizeof (struct caam_pkey_info );memcpy (p->key, &info.pkey_info,sizeof (struct caam_pkey_info ));
Ahmad Fatoum
maintainerHello,
Quoted 2 lines · yebin
Ignore this patch as 275a9a3f9b6a(“KEYS: trusted: Pass argument by pointer in dump_options”)already fix this issue.
What tree are you looking at? I can't find this commit in my git and the code you are purportedly patching never existed upstream.
If you run into issues exclusive to a vendor fork, you need to submit your patches to the vendor. The upstream mailing lists are for upstream.
Thanks,
Ahmad
Quoted 64 lines · Ye Bin
Quoted 60 lines
From: Ye Bin <[email protected]>
There's issue as follows:
security/keys/trusted-keys/trusted_caam.c: In function ‘dump_options’:security/keys/trusted-keys/trusted_caam.c:37:20: note: the ABI of passing struct with a flexible array member has changed in GCC 4.4 37 | static inline voiddump_options(struct caam_pkey_info pkey_info)| ^~~~~~~~~~~~To solve the above problem, pass 'struct caam_pkey_info*' type parameter to the
dump_options()function.Fixes 9eb25ca6c973 ("KEYS: trusted: caam based protected key")Signed-off-by Ye Bin <[email protected]>---
security/keys/trusted-keys/trusted_caam.c| 10 +++++-----1 file changed, 5 insertions(+), 5 deletions(-)security/ renamed from security/keys/trusted-keys/trusted_caam.c +0
-0
keys/trusted-keys/trusted_caam.c
index090099d1b04d..dd7a69bcf6a3100644security/keys/trusted-keys/trusted_caam.c +4
-4@@ -29,12 +29,12 @@ static const match_table_t key_tokens = { }; #ifdef CAAM_DEBUG -static inline void dump_options (struct caam_pkey_info pkey_info) +static inline void dump_options (struct caam_pkey_info *pkey_info) { - pr_info("key encryption algo %d\n", pkey_info.key_enc_algo); + pr_info("key encryption algo %d\n", pkey_info->key_enc_algo); } #else -static inline void dump_options (struct caam_pkey_info pkey_info) +static inline void dump_options (struct caam_pkey_info *pkey_info) { } #endif@@ -108,7 +108,7 @@ static int trusted_caam_seal(struct trusted_key_payload *p, char *datablob) ret = get_pkey_options(datablob, &info.pkey_info); if (ret < 0) return 0; - dump_options(info.pkey_info); + dump_options(&info.pkey_info); }ret =
caam_encap_blob(blobifier, &info);security/keys/trusted-keys/trusted_caam.c +1
-1@@ -140,7 +140,7 @@ static int trusted_caam_unseal(struct trusted_key_payload *p, char *datablob) ret = get_pkey_options(datablob, &info.pkey_info); if (ret < 0) return 0; - dump_options(info.pkey_info); + dump_options(&info.pkey_info); p->key_len = p->blob_len + sizeof(struct caam_pkey_info);
memcpy(p->key, &info.pkey_info, sizeof(struct caam_pkey_info));
Signature · 4 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Quoted 12 lines · Ahmad Fatoum
Hello,
Quoted 2 lines · yebin
Ignore this patch as 275a9a3f9b6a(“KEYS: trusted: Pass argument by pointer in dump_options”)already fix this issue.
What tree are you looking at? I can't find this commit in my git and the code you are purportedly patching never existed upstream.
If you run into issues exclusive to a vendor fork, you need to submit your patches to the vendor. The upstream mailing lists are for upstream.
This patch was submitted by Herbert Xu and is on linux-next.
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
commit 275a9a3f9b6a2158bfb7826074b72d5bdfb2ac35
Author: Herbert Xu <[email protected]> Date: Tue Oct 21 12:07:56 2025 +0800
KEYS: trusted: Pass argument by pointer in dump_options
Instead of passing pkey_info into dump_options by value, using a pointer instead.
Quoted 68 lines
Thanks,
AhmadQuoted 64 lines · Ye Bin
Quoted 60 lines
From: Ye Bin <[email protected]>
There's issue as follows:
security/keys/trusted-keys/trusted_caam.c: In function ‘dump_options’:security/keys/trusted-keys/trusted_caam.c:37:20: note: the ABI of passing struct with a flexible array member has changed in GCC 4.4
37 | static inline voiddump_options(struct caam_pkey_info pkey_info)
| ^~~~~~~~~~~~To solve the above problem, pass 'struct caam_pkey_info*' type parameter to the
dump_options()function.Fixes 9eb25ca6c973 ("KEYS: trusted: caam based protected key")Signed-off-by Ye Bin <[email protected]>--- security/keys/trusted-keys/trusted_caam.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)security/ renamed from security/keys/trusted-keys/trusted_caam.c +0
-0
keys/trusted-keys/trusted_caam.c
index090099d1b04d..dd7a69bcf6a3100644security/keys/trusted-keys/trusted_caam.c +4
-4@@ -29,12 +29,12 @@ static const match_table_t key_tokens = { };#ifdef CAAM_DEBUG -static inline void dump_options (struct caam_pkey_info pkey_info) +static inline void dump_options (struct caam_pkey_info *pkey_info) { -pr_info ("key encryption algo %d\n" , pkey_info.key_enc_algo); +pr_info ("key encryption algo %d\n" , pkey_info->key_enc_algo); }#else -static inline void dump_options (struct caam_pkey_info pkey_info) +static inline void dump_options (struct caam_pkey_info *pkey_info) { }#endif @@ -108,7 +108,7 @@ static int trusted_caam_seal(struct trusted_key_payload *p, char *datablob) ret =get_pkey_options (datablob, &info.pkey_info);if (ret <0 )return 0 ; -dump_options (info.pkey_info); +dump_options (&info.pkey_info); }ret = caam_encap_blob(blobifier, &info);security/keys/trusted-keys/trusted_caam.c +1
-1@@ -140,7 +140,7 @@ static int trusted_caam_unseal(struct trusted_key_payload *p, char *datablob) ret =get_pkey_options (datablob, &info.pkey_info);if (ret <0 )return 0 ; -dump_options (info.pkey_info); +dump_options (&info.pkey_info); p->key_len = p->blob_len +sizeof (struct caam_pkey_info );memcpy(p->key, &info.pkey_info, sizeof(struct caam_pkey_info));
Ahmad Fatoum
maintainerHi,
Quoted 22 lines · yebin
Quoted 12 lines · Ahmad Fatoum
Hello,
Quoted 2 lines · yebin
Ignore this patch as 275a9a3f9b6a(“KEYS: trusted: Pass argument by pointer in dump_options”)already fix this issue.
What tree are you looking at? I can't find this commit in my git and the code you are purportedly patching never existed upstream.
If you run into issues exclusive to a vendor fork, you need to submit your patches to the vendor. The upstream mailing lists are for upstream.
This patch was submitted by Herbert Xu and is on linux-next.
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
commit275a9a3f9b6a2158bfb7826074b72d5bdfb2ac35
Author: Herbert Xu <[email protected]>
Date: Tue Oct 21 12:07:56 2025 +0800
Quoted 7 lines
KEYS: trusted: Pass argument by pointer in
dump_optionsInstead of passing
pkey_infointodump_optionsby value, using a pointer instead.Reported-by Stephen Rothwell <[email protected]>Signed-off-by Herbert Xu <[email protected]>
Thanks for the clarification. The maintainers for trusted keys were unfortunately not Cc'd on that submission, so it flew at least under my radar. :/
Cheers,
Ahmad
Quoted 75 lines
Quoted 73 lines
Thanks,
AhmadQuoted 67 lines · Ye Bin
Quoted 63 lines
From: Ye Bin <[email protected]>
There's issue as follows:
security/keys/trusted-keys/trusted_caam.c: In function ‘dump_options’:security/keys/trusted-keys/trusted_caam.c:37:20: note: the ABI of passing struct with a flexible array member has changed in GCC 4.4 37 | static inline voiddump_options(struct caam_pkey_info pkey_info)
| ^~~~~~~~~~~~To solve the above problem, pass 'struct caam_pkey_info*' type parameter
to thedump_options()function.Fixes 9eb25ca6c973 ("KEYS: trusted: caam based protected key")Signed-off-by Ye Bin <[email protected]>---
security/keys/trusted-keys/trusted_caam.c| 10 +++++-----1 file changed, 5 insertions(+), 5 deletions(-)security/ renamed from security/keys/trusted-keys/trusted_caam.c +0
-0
keys/trusted-keys/trusted_caam.c
index090099d1b04d..dd7a69bcf6a3100644security/keys/trusted-keys/trusted_caam.c +4
-4@@ -29,12 +29,12 @@ static const match_table_t key_tokens = { }; #ifdef CAAM_DEBUG -static inline void dump_options (struct caam_pkey_info pkey_info) +static inline void dump_options (struct caam_pkey_info *pkey_info) { - pr_info("key encryption algo %d\n", pkey_info.key_enc_algo); + pr_info("key encryption algo %d\n", pkey_info->key_enc_algo); } #else -static inline void dump_options (struct caam_pkey_info pkey_info) +static inline void dump_options (struct caam_pkey_info *pkey_info) { } #endif@@ -108,7 +108,7 @@ static int trusted_caam_seal(struct trusted_key_payload *p, char *datablob) ret = get_pkey_options(datablob, &info.pkey_info); if (ret < 0) return 0; - dump_options(info.pkey_info); + dump_options(&info.pkey_info); }ret =
caam_encap_blob(blobifier, &info);security/keys/trusted-keys/trusted_caam.c +1
-1@@ -140,7 +140,7 @@ static int trusted_caam_unseal(struct trusted_key_payload *p, char *datablob) ret = get_pkey_options(datablob, &info.pkey_info); if (ret < 0) return 0; - dump_options(info.pkey_info); + dump_options(&info.pkey_info); p->key_len = p->blob_len + sizeof(struct caam_pkey_info);
memcpy(p->key, &info.pkey_info, sizeof(struct caam_pkey_info));
Signature · 4 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Jarkko Sakkinen
maintainerQuoted 27 lines · Ye Bin
From: Ye Bin <[email protected]>
There's issue as follows:
security/keys/trusted-keys/trusted_caam.c: In function ‘dump_options’:security/keys/trusted-keys/trusted_caam.c:37:20: note: the ABI of passing struct with a flexible array member has changed in GCC 4.4
37 | static inline voiddump_options(struct caam_pkey_info pkey_info)| ^~~~~~~~~~~~To solve the above problem, pass 'struct caam_pkey_info*' type parameter to the
dump_options()function.Fixes 9eb25ca6c973 ("KEYS: trusted: caam based protected key")Signed-off-by Ye Bin <[email protected]>--- security/keys/trusted-keys/trusted_caam.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)security/keys/trusted-keys/trusted_caam.c +1
-1@@ -29,12 +29,12 @@ static const match_table_t key_tokens = { };#ifdef CAAM_DEBUG -static inline void dump_options (struct caam_pkey_info pkey_info) +static inline void dump_options (struct caam_pkey_info *pkey_info)
security/keys/trusted-keys/trusted_caam.c static const match_table_t key_tokens = { · line 40
Quoted 10 lines
security/keys/trusted-keys/trusted_caam.c +2
-2{ -pr_info ("key encryption algo %d\n" , pkey_info.key_enc_algo); +pr_info ("key encryption algo %d\n" , pkey_info->key_enc_algo); }#else -static inline void dump_options (struct caam_pkey_info pkey_info) +static inline void dump_options (struct caam_pkey_info *pkey_info) { }#endif
Please fix the broken design while at it:
1. Remove the ad-hoc compilation flag (i.e., CAAM_DEBUG).
2. Substitute pr_info calls with pr_debug calls.
Then you can turn then on and off either dynamically, or alternatively from the kernel command-line [1].
[1] https://www.kernel.org/doc/html/latest/admin-guide/dynamic-debug-howto.html
BR, Jarkko
Quoted 41 lines · Jarkko Sakkinen
Quoted 27 lines · Ye Bin
From: Ye Bin <[email protected]>
There's issue as follows:
security/keys/trusted-keys/trusted_caam.c: In function ‘dump_options’:security/keys/trusted-keys/trusted_caam.c:37:20: note: the ABI of passing struct with a flexible array member has changed in GCC 4.4
37 | static inline voiddump_options(struct caam_pkey_info pkey_info)
| ^~~~~~~~~~~~To solve the above problem, pass 'struct caam_pkey_info*' type parameter to the
dump_options()function.Fixes 9eb25ca6c973 ("KEYS: trusted: caam based protected key")Signed-off-by Ye Bin <[email protected]>--- security/keys/trusted-keys/trusted_caam.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)security/keys/trusted-keys/trusted_caam.c +1
-1@@ -29,12 +29,12 @@ static const match_table_t key_tokens = { };#ifdef CAAM_DEBUG -static inline void dump_options (struct caam_pkey_info pkey_info) +static inline void dump_options (struct caam_pkey_info *pkey_info)security/keys/trusted-keys/trusted_caam.c static const match_table_t key_tokens = { · line 40
Quoted 10 lines
security/keys/trusted-keys/trusted_caam.c +2
-2{ -pr_info ("key encryption algo %d\n" , pkey_info.key_enc_algo); +pr_info ("key encryption algo %d\n" , pkey_info->key_enc_algo); }#else -static inline void dump_options (struct caam_pkey_info pkey_info) +static inline void dump_options (struct caam_pkey_info *pkey_info) { }#endif Please fix the broken design while at it:
Quoted 3 lines
1. Remove the ad-hoc compilation flag (i.e.,
CAAM_DEBUG).
2. Substitutepr_infocalls withpr_debugcalls.
Alright, I'll fix the two points you mentioned.
Quoted 7 lines
Then you can turn then on and off either dynamically, or alternatively from the kernel command-line [1].
[1] https://www.kernel.org/doc/html/latest/admin-guide/dynamic-debug-howto.html
BR, Jarkko