Skip to contentSkip to conversation

KEYS: include header for EINVAL definition

PATCH In review [email protected] 3 participants 7 messages Jan 7, 2024 – Jan 26, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KEYS: include header for EINVAL definition

From: Clay Chang <[email protected]>

This patch includes linux/errno.h to address the issue of 'EINVAL' being undeclared.

---
 include/crypto/public_key.h | 1 +
 1 file changed, 1 insertion(+)
include/crypto/public_key.h +1 -0
index 462f8a34cdf8..b7f308977c84 100644
@@ -10,6 +10,7 @@
 #ifndef _LINUX_PUBLIC_KEY_H
 #define _LINUX_PUBLIC_KEY_H
 
+#include <linux/errno.h>
 #include <linux/keyctl.h>
 #include <linux/oid_registry.h>
 
Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 15 lines · EET,

From: Clay Chang <[email protected]>

This patch includes linux/errno.h to address the issue of 'EINVAL' being undeclared.

---
 include/crypto/public_key.h | 1 +
 1 file changed, 1 insertion(+)
include/crypto/public_key.h +0 -0
index 462f8a34cdf8..b7f308977c84 100644

include/crypto/public_key.h line 16

Quoted 7 lines
include/crypto/public_key.h +1 -0
@@ -10,6 +10,7 @@
 #ifndef _LINUX_PUBLIC_KEY_H
 #define _LINUX_PUBLIC_KEY_H
 
+#include <linux/errno.h>
 #include <linux/keyctl.h>
 #include <linux/oid_registry.h>
 

Please provide evidence that issue exist (applies for any possible kernel issue).

BR, Jarkko

author
#2 lore raw

Hi Jarkko,

The issue was found when crypto/public_key.h was included, but CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE was not enabled. If CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE was not enabled, the public_key_verify_signature simply returned -EINVAL, which was not declared without linux/errno.h being included.

Thanks,
Clay

Quoted 27 lines · Jarkko Sakkinen
Quoted 15 lines · EET,

From: Clay Chang <[email protected]>

This patch includes linux/errno.h to address the issue of 'EINVAL' being undeclared.

---
 include/crypto/public_key.h | 1 +
 1 file changed, 1 insertion(+)
include/crypto/public_key.h +0 -0
index 462f8a34cdf8..b7f308977c84 100644

include/crypto/public_key.h line 16

Quoted 7 lines
include/crypto/public_key.h +1 -0
@@ -10,6 +10,7 @@
 #ifndef _LINUX_PUBLIC_KEY_H
 #define _LINUX_PUBLIC_KEY_H
 
+#include <linux/errno.h>
 #include <linux/keyctl.h>
 #include <linux/oid_registry.h>
 

Please provide evidence that issue exist (applies for any possible kernel issue).

BR, Jarkko

maintainer
#3 lore raw
Quoted 10 lines · Clay Chang

Hi Jarkko,

The issue was found when crypto/public_key.h was included, but CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE was not enabled. If CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE was not enabled, the public_key_verify_signature simply returned -EINVAL, which was not declared without linux/errno.h being included.

Thanks,
Clay

Do you have .config to verify this?

BR, Jarkko

author
#4 lore raw

Hi Jarkko,

Yes, I have. I am working on an OpenBMC project and the kernel .config was generated by merging several config fragments. In one experiment where the CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE was not presented, I got a EINVAL undeclared compilation error.

Do you want me to show the full .config here?

Thanks,
Clay

Quoted 15 lines · Jarkko Sakkinen
Quoted 10 lines · Clay Chang

Hi Jarkko,

The issue was found when crypto/public_key.h was included, but CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE was not enabled. If CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE was not enabled, the public_key_verify_signature simply returned -EINVAL, which was not declared without linux/errno.h being included.

Thanks,
Clay

Do you have .config to verify this?

BR, Jarkko

maintainer
#5 lore raw
Quoted 5 lines · Clay Chang

Hi Jarkko,

Yes, I have. I am working on an OpenBMC project and the kernel .config was generated by merging several config fragments. In one experiment where the CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE was not presented, I got a EINVAL undeclared compilation error.

Do you want me to show the full .config here?

Well the problem with the patch is that it does not *prove* that there is issue.

So you evidence in the commit message that there is bug in the first place and which config options cause it. And it it must be testable with latest mainline (not by downstream project).

BR, Jarkko

maintainer
#6 lore raw
In reply to [email protected]
Quoted 9 lines · On Sun, Jan 07, 2024 at 09:28:42PM +0800, [email protected] wrote:

From: Clay Chang <[email protected]>

This patch includes linux/errno.h to address the issue of 'EINVAL' being undeclared.

---
 include/crypto/public_key.h | 1 +
 1 file changed, 1 insertion(+)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt