security/keys: make BIG_KEYS dependent on stdrng.
Subsystems (2)
PATCH 1/1 security/keys: make BIG_KEYS dependent on stdrng.
Since BIG_KEYS can't be compiled as module it requires one of the "stdrng" providers to be compiled into kernel. Otherwise big_key_crypto_init() fails on crypto_alloc_rng step and next dereference of big_key_skcipher (e.g. in big_key_preparse()) results in a NULL pointer dereference.
--- security/keys/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
security/keys/Kconfig +1 -1
@@ -41,7 +41,7 @@ config BIG_KEYS bool "Large payload keys" depends on KEYS depends on TMPFS - select CRYPTO + depends on (CRYPTO_ANSI_CPRNG = y || CRYPTO_DRBG = y) select CRYPTO_AES select CRYPTO_ECB select CRYPTO_RNG
Signature · 1 line
2.7.4
David Howells
maintainersecurity/keys/Kconfig config BIG_KEYS · line 44
Quoted 2 lines · Artem Savkov
security/keys/Kconfig +1
-1- select CRYPTO + depends on (CRYPTO_ANSI_CPRNG = y || CRYPTO_DRBG = y)
Should those be "==" not "="?
David
Quoted 6 lines · David Howells
security/keys/Kconfig config BIG_KEYS · line 44
Quoted 2 lines · Artem Savkov
security/keys/Kconfig +1
-1- select CRYPTO + depends on (CRYPTO_ANSI_CPRNG = y || CRYPTO_DRBG = y)Should those be "==" not "="?
Accodring to Documentation/kbuild/kconfig-language.txt (line 173) it is "=" and I can only see "=" being used in existing Kconfigs.
Signature · 2 lines
Regards, Artem
David Howells
maintainerQuoted 7 lines · Artem Savkov
Quoted 4 lines
Review
Quoted 2 lines
(quoted diff) +1
-1- select CRYPTO + depends on (CRYPTO_ANSI_CPRNG = y || CRYPTO_DRBG = y)Should those be "==" not "="?
Accodring to
Documentation/kbuild/kconfig-language.txt(line 173) it is "=" and I can only see "=" being used in existing Kconfigs.
Okay. The other thing is that I have been given a conflicting patch (see below). Is your fix preferable?
David
---
commit 69ed34b303f87a1a53470dd37149ac1573d79da2
Author: Kirill Marinushkin <[email protected]>
Date: Mon, 8 Aug 2016 23:19:32 +0200
KEYS: fix big_key dependency
--- security/keys/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
security/keys/Kconfig +1 -1
@@ -44,7 +44,7 @@ config BIG_KEYS select CRYPTO select CRYPTO_AES select CRYPTO_ECB - select CRYPTO_RNG + select CRYPTO_ANSI_CPRNG help This option provides support for holding large keys within the kernel (for example Kerberos ticket caches). The data may be stored out to
Am Dienstag, 6. September 2016, 14:11:56 CEST schrieb David Howells:
Hi David,
Quoted 11 lines
Quoted 7 lines · Artem Savkov
Quoted 4 lines
Review
Quoted 2 lines
(quoted diff) +1
-1- select CRYPTO + depends on (CRYPTO_ANSI_CPRNG = y || CRYPTO_DRBG = y)Should those be "==" not "="?
Accodring to
Documentation/kbuild/kconfig-language.txt(line 173) it is "=" and I can only see "=" being used in existing Kconfigs.Okay. The other thing is that I have been given a conflicting patch (see below). Is your fix preferable?
The listed patch only selects the ANSI X9.31 DRNG and thus conflicts with FIPS mode and the current default stdrng which is the DRBG.
Ciao
Stephan
Quoted 35 lines · David Howells
Quoted 7 lines · Artem Savkov
Quoted 4 lines
Review
Quoted 2 lines
(quoted diff) +1
-1- select CRYPTO + depends on (CRYPTO_ANSI_CPRNG = y || CRYPTO_DRBG = y)Should those be "==" not "="?
Accodring to
Documentation/kbuild/kconfig-language.txt(line 173) it is "=" and I can only see "=" being used in existing Kconfigs.Okay. The other thing is that I have been given a conflicting patch (see below). Is your fix preferable?
David
---
commit69ed34b303f87a1a53470dd37149ac1573d79da2
Author: Kirill Marinushkin <[email protected]>
Date: Mon, 8 Aug 2016 23:19:32 +0200KEYS: fix
big_keydependencySigned-off-by Kirill Marinushkin <[email protected]>cc David Howells <[email protected]>cc Peter Hlavaty <[email protected]>cc Greg KH <[email protected]>--- security/keys/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)security/keys/Kconfig +0
-0
security/keys/Kconfig config BIG_KEYS · line 50
Quoted 8 lines
security/keys/Kconfig +1
-1@@ -44,7 +44,7 @@ config BIG_KEYS select CRYPTO select CRYPTO_AES select CRYPTO_ECB - select CRYPTO_RNG + select CRYPTO_ANSI_CPRNG help This option provides support for holding large keys within the kernel (for example Kerberos ticket caches). The data may be stored out to
I would argue that locking a user into a specific stdrng implementation is not something that should be done when there are options available.
Signature · 2 lines
Regards, Artem
Quoted 2 lines
The other thing is that I have been given a conflicting patch (see below). Is your fix preferable?
The patch you attached previously is v1; I submitted v2 after review by Stephan Mueller. I additionally attach it here below.
IMO, the preferable fix depends on your future plan.
If you plan to continue using both ANSI X9.31 DRNG and DRBG - I agree with the patch suggested by Artem Savkov.
If you plan to reduce using ANSI X9.31 DRNG and use DRBG more widely - I suggest my patch.
Best Regards,
Kirill
---
From Kirill Marinushkin <[email protected]>
Subject [PATCH v2] KEYS: fix big_key dependency
Date Tue, 16 Aug 2016 21:51:12 +0200
This patch fixes the following bug:
[oss-security] - panic at big_key_preparse #4.7-r6/rc7 & master
--- security/keys/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
security/keys/Kconfig +1 -1
@@ -44,7 +44,7 @@ config BIG_KEYS select CRYPTO select CRYPTO_AES select CRYPTO_ECB - select CRYPTO_RNG + select CRYPTO_RNG_DEFAULT
David Howells
maintainerQuoted 5 lines · Kirill Marinushkin
IMO, the preferable fix depends on your future plan.
If you plan to continue using both ANSI X9.31 DRNG and DRBG - I agree with the patch suggested by Artem Savkov.
If you plan to reduce using ANSI X9.31 DRNG and use DRBG more widely - I suggest my patch.
No such plans, TBH.
David
Quoted 9 lines · David Howells
Quoted 5 lines · Kirill Marinushkin
IMO, the preferable fix depends on your future plan.
If you plan to continue using both ANSI X9.31 DRNG and DRBG - I agree with the patch suggested by Artem Savkov.
If you plan to reduce using ANSI X9.31 DRNG and use DRBG more widely - I suggest my patch.No such plans, TBH.
I agre with Kirill here, so if we are not trying to reduce ANSI X9.31 DRNG usage can we move on with the suggested patch, or are there any issues with it that need addressing?
Signature · 2 lines
Regards, Artem
David Howells
maintainerQuoted 11 lines · Artem Savkov
Quoted 7 lines
Quoted 5 lines
IMO, the preferable fix depends on your future plan.
If you plan to continue using both ANSI X9.31 DRNG and DRBG - I agree with the patch suggested by Artem Savkov.
If you plan to reduce using ANSI X9.31 DRNG and use DRBG more widely - I suggest my patch.No such plans, TBH.
I agre with Kirill here, so if we are not trying to reduce ANSI X9.31 DRNG usage can we move on with the suggested patch, or are there any issues with it that need addressing?
Which suggested patch? One of Kirill's (there are at least two) or yours?
Note that we *also* need the "KEYS: Sort out big_key initialisation" patch - just changing the Kconfig is not sufficient a fix in and of itself.
David
Quoted 8 lines · David Howells
Quoted 6 lines · Artem Savkov
Quoted 6 lines
Quoted 5 lines
IMO, the preferable fix depends on your future plan.
If you plan to continue using both ANSI X9.31 DRNG and DRBG - I agree with the patch suggested by Artem Savkov.
If you plan to reduce using ANSI X9.31 DRNG and use DRBG more widely - I suggest my patch.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
No such plans, TBH.
I agre with Kirill here, so if we are not trying to reduce ANSI X9.31 DRNG usage can we move on with the suggested patch, or are there any issues with it that need addressing?
Which suggested patch? One of Kirill's (there are at least two) or yours?
I suggest mine, since it is more flexible.
Quoted 2 lines
Note that we *also* need the "KEYS: Sort out
big_keyinitialisation" patch - just changing theKconfigis not sufficient a fix in and of itself.
Right, I see it also changes the Kconfig, so we might be better off with v2 of "KEYS: Sort out big_key initialisation" with "depends on (CRYPTO_ANSI_CPRNG = y || CRYPTO_DRBG = y)" in Kconfig.
Signature · 2 lines
Regards, Artem
David Howells
maintainerQuoted 3 lines · Artem Savkov
Quoted 1 line
Which suggested patch? One of Kirill's (there are at least two) or yours?
I suggest mine, since it is more flexible.
Fine by me.
Quoted 4 lines
Quoted 2 lines
Note that we *also* need the "KEYS: Sort out
big_keyinitialisation" patch - just changing theKconfigis not sufficient a fix in and of itself.Right, I see it also changes the
Kconfig
No, it doesn't. It only changes big_key.c
David