2011-10-26 00:42:01

by Randy Dunlap

[permalink] [raw]
Subject: Re: linux-next: Tree for Oct 25 (crypto)

On 10/25/11 02:36, Stephen Rothwell wrote:
> Hi all,


When CONFIG_NET is not enabled:

ERROR: "nla_put" [crypto/rng.ko] undefined!
ERROR: "nla_put" [crypto/pcompress.ko] undefined!
ERROR: "netlink_kernel_release" [crypto/crypto_user.ko] undefined!
ERROR: "netlink_kernel_create" [crypto/crypto_user.ko] undefined!
ERROR: "init_net" [crypto/crypto_user.ko] undefined!
ERROR: "netlink_unicast" [crypto/crypto_user.ko] undefined!
ERROR: "__alloc_skb" [crypto/crypto_user.ko] undefined!
ERROR: "skb_trim" [crypto/crypto_user.ko] undefined!
ERROR: "skb_put" [crypto/crypto_user.ko] undefined!
ERROR: "netlink_dump_start" [crypto/crypto_user.ko] undefined!
ERROR: "nla_put" [crypto/crypto_user.ko] undefined!
ERROR: "netlink_rcv_skb" [crypto/crypto_user.ko] undefined!
ERROR: "nla_put" [crypto/crypto_hash.ko] undefined!
ERROR: "nla_put" [crypto/crypto_blkcipher.ko] undefined!
ERROR: "nla_put" [crypto/aead.ko] undefined!


--
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***


2011-10-26 06:27:17

by Herbert Xu

[permalink] [raw]
Subject: Re: linux-next: Tree for Oct 25 (crypto)

On Tue, Oct 25, 2011 at 05:42:01PM -0700, Randy Dunlap wrote:
> On 10/25/11 02:36, Stephen Rothwell wrote:
> > Hi all,
>
>
> When CONFIG_NET is not enabled:

Thanks, I'll add this patch.

diff --git a/crypto/Kconfig b/crypto/Kconfig
index a8442dc..259dea9 100644
--- a/crypto/Kconfig
+++ b/crypto/Kconfig
@@ -103,6 +103,7 @@ config CRYPTO_MANAGER2
config CRYPTO_USER
tristate "Userspace cryptographic algorithm configuration"
select CRYPTO_MANAGER
+ select NET
help
Userapace configuration for cryptographic instantiations such as
cbc(aes).

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

2011-10-26 12:34:18

by Stefan Richter

[permalink] [raw]
Subject: Re: linux-next: Tree for Oct 25 (crypto)

On Oct 26 Herbert Xu wrote:
> On Tue, Oct 25, 2011 at 05:42:01PM -0700, Randy Dunlap wrote:
> > On 10/25/11 02:36, Stephen Rothwell wrote:
> > > Hi all,
> >
> >
> > When CONFIG_NET is not enabled:
>
> Thanks, I'll add this patch.
>
> diff --git a/crypto/Kconfig b/crypto/Kconfig
> index a8442dc..259dea9 100644
> --- a/crypto/Kconfig
> +++ b/crypto/Kconfig
> @@ -103,6 +103,7 @@ config CRYPTO_MANAGER2
> config CRYPTO_USER
> tristate "Userspace cryptographic algorithm configuration"
> select CRYPTO_MANAGER
> + select NET
> help
> Userapace configuration for cryptographic instantiations such as
> cbc(aes).
>
> Cheers,

If you do it this way, you also need to select everything on which NET
depends on. In v3.1, that would be (only) NLATTR which in turn does not
depend on anything else.

Furthermore, I am noticing in v3.1 that CRYPTO_MANAGER selects
CRYPTO_MANAGER2 which in turn has the following dependencies:

config CRYPTO_MANAGER2
def_tristate CRYPTO_MANAGER || (CRYPTO_MANAGER!=n && CRYPTO_ALGAPI=y)
select CRYPTO_AEAD2
select CRYPTO_HASH2
select CRYPTO_BLKCIPHER2
select CRYPTO_PCOMP2

I think you need to copy those dependencies into config CRYPTO_MANAGER.
--
Stefan Richter
-=====-==-== =-=- ==-=-
http://arcgraph.de/sr/

2011-10-26 16:28:07

by Randy Dunlap

[permalink] [raw]
Subject: Re: linux-next: Tree for Oct 25 (crypto)

On 10/26/11 05:33, Stefan Richter wrote:
> On Oct 26 Herbert Xu wrote:
>> On Tue, Oct 25, 2011 at 05:42:01PM -0700, Randy Dunlap wrote:
>>> On 10/25/11 02:36, Stephen Rothwell wrote:
>>>> Hi all,
>>>
>>>
>>> When CONFIG_NET is not enabled:
>>
>> Thanks, I'll add this patch.
>>
>> diff --git a/crypto/Kconfig b/crypto/Kconfig
>> index a8442dc..259dea9 100644
>> --- a/crypto/Kconfig
>> +++ b/crypto/Kconfig
>> @@ -103,6 +103,7 @@ config CRYPTO_MANAGER2
>> config CRYPTO_USER
>> tristate "Userspace cryptographic algorithm configuration"
>> select CRYPTO_MANAGER
>> + select NET
>> help
>> Userapace configuration for cryptographic instantiations such as
>> cbc(aes).
>>
>> Cheers,
>
> If you do it this way, you also need to select everything on which NET
> depends on. In v3.1, that would be (only) NLATTR which in turn does not
> depend on anything else.
>
> Furthermore, I am noticing in v3.1 that CRYPTO_MANAGER selects
> CRYPTO_MANAGER2 which in turn has the following dependencies:
>
> config CRYPTO_MANAGER2
> def_tristate CRYPTO_MANAGER || (CRYPTO_MANAGER!=n && CRYPTO_ALGAPI=y)
> select CRYPTO_AEAD2
> select CRYPTO_HASH2
> select CRYPTO_BLKCIPHER2
> select CRYPTO_PCOMP2
>
> I think you need to copy those dependencies into config CRYPTO_MANAGER.

That's correct, but it's better not to "select" an entire subsystem
like NET at all.

--
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

2011-10-26 17:15:17

by Stefan Richter

[permalink] [raw]
Subject: Re: linux-next: Tree for Oct 25 (crypto)

On Oct 26 Randy Dunlap wrote:
> On 10/26/11 05:33, Stefan Richter wrote:
> > On Oct 26 Herbert Xu wrote:
> >> --- a/crypto/Kconfig
> >> +++ b/crypto/Kconfig
> >> @@ -103,6 +103,7 @@ config CRYPTO_MANAGER2
> >> config CRYPTO_USER
> >> tristate "Userspace cryptographic algorithm configuration"
> >> select CRYPTO_MANAGER
> >> + select NET
> >> help
> >> Userapace configuration for cryptographic instantiations such as

btw, typo: "Userspace"

> >> cbc(aes).
> >>
> >> Cheers,
> >
> > If you do it this way, you also need to select everything on which NET
> > depends on. In v3.1, that would be (only) NLATTR which in turn does not
> > depend on anything else.
[...]
> That's correct, but it's better not to "select" an entire subsystem
> like NET at all.

I agree; I add to my comment the implication that --- as a rule of thumb
--- "select" should be avoided if the option to be selected has further
dependencies.

A downside of "config A\n depends on B" is of course that potential users
of option A who are unaware of option B or not interested in B may miss how
to enable A. Sometimes, a comment in the Kconfig file can help then.
Example (from linux-2.6.36/drivers/ieee1394/):

comment "PCILynx controller requires I2C"
depends on IEEE1394 && I2C=n

config IEEE1394_PCILYNX
tristate "PCILynx controller"
depends on PCI && IEEE1394 && I2C
select I2C_ALGOBIT
help
Say Y here if you have an IEEE-1394 controller with the Texas
Instruments PCILynx chip.
--
Stefan Richter
-=====-==-== =-=- ==-=-
http://arcgraph.de/sr/

2011-10-27 07:05:16

by Valdis Klētnieks

[permalink] [raw]
Subject: Re: linux-next: Tree for Oct 25 (crypto)

On Wed, 26 Oct 2011 08:27:17 +0200, Herbert Xu said:
> On Tue, Oct 25, 2011 at 05:42:01PM -0700, Randy Dunlap wrote:
> > When CONFIG_NET is not enabled:
>
> Thanks, I'll add this patch.

> diff --git a/crypto/Kconfig b/crypto/Kconfig
> + select NET

Are there any use cases where a config (probably embedded) would wantq
CRYPTO_USER but not CRYPTO_NET? Would seem a shame to pull in the entire
CONFIG_NET stuff just for what appears to me to be a few utility routines (I
know there's still a few people out there fighting kernel bloat).

In any case, I suspect that sort of restructuring will be 3.3 material - this does
look like the right fix for this merge window.


Attachments:
(No filename) (227.00 B)

2011-10-27 07:45:44

by Herbert Xu

[permalink] [raw]
Subject: Re: linux-next: Tree for Oct 25 (crypto)

On Thu, Oct 27, 2011 at 03:05:16AM -0400, [email protected] wrote:
> On Wed, 26 Oct 2011 08:27:17 +0200, Herbert Xu said:
> > On Tue, Oct 25, 2011 at 05:42:01PM -0700, Randy Dunlap wrote:
> > > When CONFIG_NET is not enabled:
> >
> > Thanks, I'll add this patch.
>
> > diff --git a/crypto/Kconfig b/crypto/Kconfig
> > + select NET
>
> Are there any use cases where a config (probably embedded) would wantq
> CRYPTO_USER but not CRYPTO_NET? Would seem a shame to pull in the entire

Since the CRYPTO_USER interface sits on top of netlink I don't
see how you could possibly avoid NET.

Thanks,
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

2011-10-29 23:21:55

by Valdis Klētnieks

[permalink] [raw]
Subject: Re: linux-next: Tree for Oct 25 (crypto)

On Thu, 27 Oct 2011 09:45:44 +0200, Herbert Xu said:
> On Thu, Oct 27, 2011 at 03:05:16AM -0400, [email protected] wrote:

> > Are there any use cases where a config (probably embedded) would wantq
> > CRYPTO_USER but not CRYPTO_NET? Would seem a shame to pull in the entire
>
> Since the CRYPTO_USER interface sits on top of netlink I don't
> see how you could possibly avoid NET.

Oh, OK. The original bug report looked like just some utility functions not
defined, so I didn't pick up on the "it needs netlink" aspect of it.


Attachments:
(No filename) (227.00 B)