2007-11-22 15:34:27

by Ingo Molnar

[permalink] [raw]
Subject: [build bug] ./net/rxrpc/ar-key.c fails to build


on the latest kernel (2.6.24-rc3-git1) the attached config triggers the
following build error:

net/built-in.o: In function `rxrpc_destroy_s':
ar-key.c:(.text+0x9c50d): undefined reference to `crypto_free_tfm'
net/built-in.o: In function `rxrpc_instantiate_s':
ar-key.c:(.text+0x9c613): undefined reference to `crypto_alloc_base'

Ingo


Attachments:
(No filename) (339.00 B)
config (43.11 kB)
Download all attachments

2007-11-22 19:01:35

by David Howells

[permalink] [raw]
Subject: Re: [build bug] ./net/rxrpc/ar-key.c fails to build

Ingo Molnar <[email protected]> wrote:

> on the latest kernel (2.6.24-rc3-git1) the attached config triggers the
> following build error:
>
> net/built-in.o: In function `rxrpc_destroy_s':
> ar-key.c:(.text+0x9c50d): undefined reference to `crypto_free_tfm'
> net/built-in.o: In function `rxrpc_instantiate_s':
> ar-key.c:(.text+0x9c613): undefined reference to `crypto_alloc_base'

I see it. The simplest answer is just to make AF_RXRPC select CRYPTO.
However, that's probably not the right solution in the long run (the common
secret key management code assumes stuff about the key payload and the crypto
algorithms used that it shouldn't).

David

2007-11-28 12:45:42

by Ingo Molnar

[permalink] [raw]
Subject: [build bug] SCTP, net/sctp/auth.c, ./net/rxrpc/ar-key.c fails to build


* Ingo Molnar <[email protected]> wrote:

> on the latest kernel (2.6.24-rc3-git1) the attached config triggers the
> following build error:
>
> net/built-in.o: In function `rxrpc_destroy_s':
> ar-key.c:(.text+0x9c50d): undefined reference to `crypto_free_tfm'
> net/built-in.o: In function `rxrpc_instantiate_s':
> ar-key.c:(.text+0x9c613): undefined reference to `crypto_alloc_base'

a similar build bug happens with latest -git as well, with SCTP:

net/built-in.o: In function `rxrpc_destroy_s':
ar-key.c:(.text+0xc5a2b): undefined reference to `crypto_free_tfm'
net/built-in.o: In function `rxrpc_instantiate_s':
ar-key.c:(.text+0xc5ed9): undefined reference to `crypto_alloc_base'
net/built-in.o: In function `sctp_endpoint_put':
: undefined reference to `crypto_free_tfm'
net/built-in.o: In function `sctp_inet_listen':
: undefined reference to `crypto_free_tfm'
net/built-in.o: In function `sctp_auth_destroy_hmacs':
: undefined reference to `crypto_free_tfm'
net/built-in.o: In function `sctp_auth_init_hmacs':
: undefined reference to `crypto_alloc_base'

this is a build regression over v2.6.23. config attached.

Ingo


Attachments:
(No filename) (1.11 kB)
config (42.46 kB)
Download all attachments

2007-11-28 12:48:01

by Ingo Molnar

[permalink] [raw]
Subject: Re: [build bug] SCTP, net/sctp/auth.c, ./net/rxrpc/ar-key.c fails to build


* Ingo Molnar <[email protected]> wrote:

> a similar build bug happens with latest -git as well, with SCTP:
>
> net/built-in.o: In function `rxrpc_destroy_s':
> ar-key.c:(.text+0xc5a2b): undefined reference to `crypto_free_tfm'
> net/built-in.o: In function `rxrpc_instantiate_s':
> ar-key.c:(.text+0xc5ed9): undefined reference to `crypto_alloc_base'
> net/built-in.o: In function `sctp_endpoint_put':
> : undefined reference to `crypto_free_tfm'
> net/built-in.o: In function `sctp_inet_listen':
> : undefined reference to `crypto_free_tfm'
> net/built-in.o: In function `sctp_auth_destroy_hmacs':
> : undefined reference to `crypto_free_tfm'
> net/built-in.o: In function `sctp_auth_init_hmacs':
> : undefined reference to `crypto_alloc_base'
>
> this is a build regression over v2.6.23. config attached.

the patch below fix it (or rather, works it around).

Ingo

------------->
Subject: SCTP: fix build bug
From: Ingo Molnar <[email protected]>

fix build bug:

net/built-in.o: In function `rxrpc_destroy_s':
ar-key.c:(.text+0xc5a2b): undefined reference to `crypto_free_tfm'
net/built-in.o: In function `rxrpc_instantiate_s':
ar-key.c:(.text+0xc5ed9): undefined reference to `crypto_alloc_base'
net/built-in.o: In function `sctp_endpoint_put':
: undefined reference to `crypto_free_tfm'
net/built-in.o: In function `sctp_inet_listen':
: undefined reference to `crypto_free_tfm'
net/built-in.o: In function `sctp_auth_destroy_hmacs':
: undefined reference to `crypto_free_tfm'
net/built-in.o: In function `sctp_auth_init_hmacs':
: undefined reference to `crypto_alloc_base'

Signed-off-by: Ingo Molnar <[email protected]>
---
net/sctp/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux/net/sctp/Kconfig
===================================================================
--- linux.orig/net/sctp/Kconfig
+++ linux/net/sctp/Kconfig
@@ -6,7 +6,7 @@ menuconfig IP_SCTP
tristate "The SCTP Protocol (EXPERIMENTAL)"
depends on INET && EXPERIMENTAL
depends on IPV6 || IPV6=n
- select CRYPTO if SCTP_HMAC_SHA1 || SCTP_HMAC_MD5
+ select CRYPTO
select CRYPTO_HMAC if SCTP_HMAC_SHA1 || SCTP_HMAC_MD5
select CRYPTO_SHA1 if SCTP_HMAC_SHA1
select CRYPTO_MD5 if SCTP_HMAC_MD5

2007-11-28 14:38:24

by David Howells

[permalink] [raw]
Subject: [PATCH] AF_RXRPC: Configure crypto correctly for AF_RXRPC

AF_RXRPC uses the crypto services, so should depend on or select CRYPTO.

Signed-off-by: David Howells <[email protected]>
---

net/rxrpc/Kconfig | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/rxrpc/Kconfig b/net/rxrpc/Kconfig
index e662f1d..0d3103c 100644
--- a/net/rxrpc/Kconfig
+++ b/net/rxrpc/Kconfig
@@ -5,6 +5,7 @@
config AF_RXRPC
tristate "RxRPC session sockets"
depends on INET && EXPERIMENTAL
+ select CRYPTO
select KEYS
help
Say Y or M here to include support for RxRPC session sockets (just

2007-11-28 14:52:00

by Vlad Yasevich

[permalink] [raw]
Subject: Re: [build bug] SCTP, net/sctp/auth.c, ./net/rxrpc/ar-key.c fails to build

Ingo Molnar wrote:
> * Ingo Molnar <[email protected]> wrote:
>
>> a similar build bug happens with latest -git as well, with SCTP:
>>
>> net/built-in.o: In function `rxrpc_destroy_s':
>> ar-key.c:(.text+0xc5a2b): undefined reference to `crypto_free_tfm'
>> net/built-in.o: In function `rxrpc_instantiate_s':
>> ar-key.c:(.text+0xc5ed9): undefined reference to `crypto_alloc_base'

looks like rx-rpc should select CRYPTO as well..

>> net/built-in.o: In function `sctp_endpoint_put':
>> : undefined reference to `crypto_free_tfm'
>> net/built-in.o: In function `sctp_inet_listen':
>> : undefined reference to `crypto_free_tfm'
>> net/built-in.o: In function `sctp_auth_destroy_hmacs':
>> : undefined reference to `crypto_free_tfm'
>> net/built-in.o: In function `sctp_auth_init_hmacs':
>> : undefined reference to `crypto_alloc_base'
>>
>> this is a build regression over v2.6.23. config attached.
>
> the patch below fix it (or rather, works it around).
>

The patch is an OK workaround, but may not yield a working SCTP.

Let me see if I can do better..

-vlad

> Ingo
>
> ------------->
> Subject: SCTP: fix build bug
> From: Ingo Molnar <[email protected]>
>
> fix build bug:
>
> net/built-in.o: In function `rxrpc_destroy_s':
> ar-key.c:(.text+0xc5a2b): undefined reference to `crypto_free_tfm'
> net/built-in.o: In function `rxrpc_instantiate_s':
> ar-key.c:(.text+0xc5ed9): undefined reference to `crypto_alloc_base'
> net/built-in.o: In function `sctp_endpoint_put':
> : undefined reference to `crypto_free_tfm'
> net/built-in.o: In function `sctp_inet_listen':
> : undefined reference to `crypto_free_tfm'
> net/built-in.o: In function `sctp_auth_destroy_hmacs':
> : undefined reference to `crypto_free_tfm'
> net/built-in.o: In function `sctp_auth_init_hmacs':
> : undefined reference to `crypto_alloc_base'
>
> Signed-off-by: Ingo Molnar <[email protected]>
> ---
> net/sctp/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Index: linux/net/sctp/Kconfig
> ===================================================================
> --- linux.orig/net/sctp/Kconfig
> +++ linux/net/sctp/Kconfig
> @@ -6,7 +6,7 @@ menuconfig IP_SCTP
> tristate "The SCTP Protocol (EXPERIMENTAL)"
> depends on INET && EXPERIMENTAL
> depends on IPV6 || IPV6=n
> - select CRYPTO if SCTP_HMAC_SHA1 || SCTP_HMAC_MD5
> + select CRYPTO
> select CRYPTO_HMAC if SCTP_HMAC_SHA1 || SCTP_HMAC_MD5
> select CRYPTO_SHA1 if SCTP_HMAC_SHA1
> select CRYPTO_MD5 if SCTP_HMAC_MD5
>

2007-11-28 14:54:24

by David Howells

[permalink] [raw]
Subject: [PATCH] AF_RXRPC: Configure crypto correctly for AF_RXRPC

AF_RXRPC uses the crypto services, so should depend on or select CRYPTO.

Signed-off-by: David Howells <[email protected]>
---

net/rxrpc/Kconfig | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/rxrpc/Kconfig b/net/rxrpc/Kconfig
index e662f1d..0d3103c 100644
--- a/net/rxrpc/Kconfig
+++ b/net/rxrpc/Kconfig
@@ -5,6 +5,7 @@
config AF_RXRPC
tristate "RxRPC session sockets"
depends on INET && EXPERIMENTAL
+ select CRYPTO
select KEYS
help
Say Y or M here to include support for RxRPC session sockets (just

2007-11-28 14:59:26

by Ingo Molnar

[permalink] [raw]
Subject: Re: [build bug] SCTP, net/sctp/auth.c, ./net/rxrpc/ar-key.c fails to build


* Vlad Yasevich <[email protected]> wrote:

>>> this is a build regression over v2.6.23. config attached.
>>
>> the patch below fix it (or rather, works it around).
>>
>
> The patch is an OK workaround, but may not yield a working SCTP.
>
> Let me see if I can do better..

i'd be glad to test any patch. Note, the config was generated via 'make
randconfig', for automated build and boot QA, and "working SCTP" is not
something that is necessary for such a kernel to boot. So the workaround
might be fine as well - not all config space combinations that are
reachable via 'make randconfig' make "sense", but they should still
build and boot fine.

Ingo

2007-11-28 15:06:15

by Vlad Yasevich

[permalink] [raw]
Subject: Re: [build bug] SCTP, net/sctp/auth.c, ./net/rxrpc/ar-key.c fails to build

diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index da8354e..e71b5f1 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -438,11 +438,14 @@ enum {
SCTP_AUTH_HMAC_ID_RESERVED_0,
SCTP_AUTH_HMAC_ID_SHA1,
SCTP_AUTH_HMAC_ID_RESERVED_2,
- SCTP_AUTH_HMAC_ID_SHA256
+#if defined (CONFIG_CRYPTO_SHA256) || defined (CONFIG_CRYPTO_SHA256_MODULE)
+ SCTP_AUTH_HMAC_ID_SHA256,
+#endif
+ __SCTP_AUTH_HMAC_MAX
};

-#define SCTP_AUTH_HMAC_ID_MAX SCTP_AUTH_HMAC_ID_SHA256
-#define SCTP_AUTH_NUM_HMACS (SCTP_AUTH_HMAC_ID_SHA256 + 1)
+#define SCTP_AUTH_HMAC_ID_MAX __SCTP_AUTH_HMAC_MAX - 1
+#define SCTP_AUTH_NUM_HMACS __SCTP_AUTH_HMAC_MAX
#define SCTP_SHA1_SIG_SIZE 20
#define SCTP_SHA256_SIG_SIZE 32

diff --git a/net/sctp/Kconfig b/net/sctp/Kconfig
index 8210f54..5390bc7 100644
--- a/net/sctp/Kconfig
+++ b/net/sctp/Kconfig
@@ -6,9 +6,9 @@ menuconfig IP_SCTP
tristate "The SCTP Protocol (EXPERIMENTAL)"
depends on INET && EXPERIMENTAL
depends on IPV6 || IPV6=n
- select CRYPTO if SCTP_HMAC_SHA1 || SCTP_HMAC_MD5
- select CRYPTO_HMAC if SCTP_HMAC_SHA1 || SCTP_HMAC_MD5
- select CRYPTO_SHA1 if SCTP_HMAC_SHA1
+ select CRYPTO
+ select CRYPTO_HMAC
+ select CRYPTO_SHA1
select CRYPTO_MD5 if SCTP_HMAC_MD5
---help---
Stream Control Transmission Protocol
diff --git a/net/sctp/auth.c b/net/sctp/auth.c
index 6d5fa6b..64b5c7a 100644
--- a/net/sctp/auth.c
+++ b/net/sctp/auth.c
@@ -54,11 +54,13 @@ static struct sctp_hmac sctp_hmac_list[SCTP_AUTH_NUM_HMACS] = {
/* id 2 is reserved as well */
.hmac_id = SCTP_AUTH_HMAC_ID_RESERVED_2,
},
+#if defined (CONFIG_CRYPTO_SHA256) || defined (CONFIG_CRYPTO_SHA256_MODULE)
{
.hmac_id = SCTP_AUTH_HMAC_ID_SHA256,
.hmac_name="hmac(sha256)",
.hmac_len = SCTP_SHA256_SIG_SIZE,
}
+#endif
};



Attachments:
foo (1.77 kB)

2007-11-30 12:07:44

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH] AF_RXRPC: Configure crypto correctly for AF_RXRPC

On Wed, Nov 28, 2007 at 02:37:53PM +0000, David Howells wrote:
> AF_RXRPC uses the crypto services, so should depend on or select CRYPTO.
>
> Signed-off-by: David Howells <[email protected]>

Patch applied to net-2.6. Thanks.
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

2007-11-30 12:12:22

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH] AF_RXRPC: Configure crypto correctly for AF_RXRPC


* Herbert Xu <[email protected]> wrote:

> On Wed, Nov 28, 2007 at 02:37:53PM +0000, David Howells wrote:
> > AF_RXRPC uses the crypto services, so should depend on or select CRYPTO.
> >
> > Signed-off-by: David Howells <[email protected]>
>
> Patch applied to net-2.6. Thanks.

aimed at 2.6.24 merging, right?

Ingo

2007-11-30 13:37:13

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH] AF_RXRPC: Configure crypto correctly for AF_RXRPC

Ingo Molnar <[email protected]> wrote:
>
>> Patch applied to net-2.6. Thanks.
>
> aimed at 2.6.24 merging, right?

Yep. net-2.6 is for 2.6.24 while net-2.6.25 is for 2.6.25.

Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt