2023-04-11 00:59:16

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: build failure after merge of the crypto tree

Hi all,

After merging the crypto tree, today's linux-next build (x86_64
allmodconfig) failed like this:

In file included from <command-line>:
In function 'setup_crypt_desc',
inlined from 'get_crypt_desc' at drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c:285:3:
include/linux/compiler_types.h:397:45: error: call to '__compiletime_assert_1010' declared with attribute error: BUILD_BUG_ON failed: sizeof(struct crypt_ctl) != 64
397 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^
include/linux/compiler_types.h:378:25: note: in definition of macro '__compiletime_assert'
378 | prefix ## suffix(); \
| ^~~~~~
include/linux/compiler_types.h:397:9: note: in expansion of macro '_compiletime_assert'
397 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c:266:9: note: in expansion of macro 'BUILD_BUG_ON'
266 | BUILD_BUG_ON(sizeof(struct crypt_ctl) != 64);
| ^~~~~~~~~~~~

Caused by commit

1bc7fdbf2677 ("crypto: ixp4xx - Move driver to drivers/crypto/intel/ixp4xx")

Presumably the addition of COMPILE_TEST was a bit optimistic. :-(

I have used the crypto tree from next-20230406 for today.

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2023-04-11 02:31:46

by Herbert Xu

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the crypto tree

On Tue, Apr 11, 2023 at 10:48:21AM +1000, Stephen Rothwell wrote:
>
> Presumably the addition of COMPILE_TEST was a bit optimistic. :-(
>
> I have used the crypto tree from next-20230406 for today.

I just pushed out a fix for it. Thanks Stephen!
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

2023-10-30 05:12:21

by Stephen Rothwell

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the crypto tree

Hi all,

On Mon, 30 Oct 2023 15:58:09 +1100 Stephen Rothwell <[email protected]> wrote:
>
> After merging the crypto tree, today's linux-next build (powerpc
> allyesconfig) failed like this:
>
> net/ipv4/tcp_ao.c: In function 'tcp_ao_key_alloc':
> net/ipv4/tcp_ao.c:1536:13: error: implicit declaration of function 'crypto_ahash_alignmask'; did you mean 'crypto_ahash_alg_name'? [-Werror=implicit-function-declaration]
> 1536 | if (crypto_ahash_alignmask(tfm) > TCP_AO_KEY_ALIGN) {
> | ^~~~~~~~~~~~~~~~~~~~~~
> | crypto_ahash_alg_name
>
> Caused by commit
>
> 0f8660c82b79 ("crypto: ahash - remove crypto_ahash_alignmask")
>
> interacting with commit
>
> 4954f17ddefc ("net/tcp: Introduce TCP_AO setsockopt()s")
>
> from the net-next tree.
>
> I have applied the following merge resolution patch for today:

From: Stephen Rothwell <[email protected]>
Date: Mon, 30 Oct 2023 15:54:37 +1100
Subject: [PATCH] fix up for "crypto: ahash - remove crypto_ahash_alignmask"

interacting with "net/tcp: Introduce TCP_AO setsockopt()s"

Signed-off-by: Stephen Rothwell <[email protected]>
---
net/ipv4/tcp_ao.c | 6 ------
1 file changed, 6 deletions(-)

diff --git a/net/ipv4/tcp_ao.c b/net/ipv4/tcp_ao.c
index 6a845e906a1d..ef5472ed6158 100644
--- a/net/ipv4/tcp_ao.c
+++ b/net/ipv4/tcp_ao.c
@@ -1533,10 +1533,6 @@ static struct tcp_ao_key *tcp_ao_key_alloc(struct sock *sk,
goto err_free_pool;

tfm = crypto_ahash_reqtfm(hp.req);
- if (crypto_ahash_alignmask(tfm) > TCP_AO_KEY_ALIGN) {
- err = -EOPNOTSUPP;
- goto err_pool_end;
- }
digest_size = crypto_ahash_digestsize(tfm);
tcp_sigpool_end(&hp);

@@ -1551,8 +1547,6 @@ static struct tcp_ao_key *tcp_ao_key_alloc(struct sock *sk,
key->digest_size = digest_size;
return key;

-err_pool_end:
- tcp_sigpool_end(&hp);
err_free_pool:
tcp_sigpool_release(pool_id);
return ERR_PTR(err);
--
2.40.1

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2023-10-30 17:45:08

by Dmitry Safonov

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the crypto tree

On 10/30/23 05:23, Herbert Xu wrote:
> On Mon, Oct 30, 2023 at 04:09:53PM +1100, Stephen Rothwell wrote:
>>
>> From: Stephen Rothwell <[email protected]>
>> Date: Mon, 30 Oct 2023 15:54:37 +1100
>> Subject: [PATCH] fix up for "crypto: ahash - remove crypto_ahash_alignmask"
>>
>> interacting with "net/tcp: Introduce TCP_AO setsockopt()s"
>>
>> Signed-off-by: Stephen Rothwell <[email protected]>
>> ---
>> net/ipv4/tcp_ao.c | 6 ------
>> 1 file changed, 6 deletions(-)
>
> Acked-by: Herbert Xu <[email protected]>

Reviewed-by: Dmitry Safonov <[email protected]>

> If we simply apply this patch to the netdev tree then everything
> should work at the next merge window. But perhaps you could change
> the patch description to say something like remove the obsolete
> crypto_hash_alignmask. It's not important though.

Thank you,
Dmitry

2023-10-31 20:14:34

by Jakub Kicinski

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the crypto tree

On Mon, 30 Oct 2023 21:51:57 -0700 Eric Biggers wrote:
> On Mon, Oct 30, 2023 at 03:02:43PM -0700, Jakub Kicinski wrote:
> > On Mon, 30 Oct 2023 13:23:53 +0800 Herbert Xu wrote:
> > > If we simply apply this patch to the netdev tree then everything
> > > should work at the next merge window. But perhaps you could change
> > > the patch description to say something like remove the obsolete
> > > crypto_hash_alignmask. It's not important though.
> >
> > I'm happy to massage the commit message and apply the fix to net.
> > But is it actually 100% correct to do that? IOW is calling
> > crypto_ahash_alignmask() already not necessary in net-next or does
> > it only become unnecessary after some prep work in crypto-next?
> >
> > We can tell Linus to squash this fix into the merge of either
> > crypto-next or net-next, I'm pretty sure he'd be okay with that..
>
> It's safe to fold the patch into net-next. It actually looks like a bug to be
> using the alignmask in the way that net/ipv4/tcp_ao.c is using it. You don't
> want to be erroring out just because the algorithm declared an alignmask.

Thanks Eric! Applied as commit f2fbb9081123 ("net: tcp: remove call to
obsolete crypto_ahash_alignmask()") to net-next. I'll respin our PR
after some sanity checking.

2024-03-13 02:12:38

by Barry Song

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the crypto tree

> The only user of comp_alg_common was the crypto stats, and it was introduced by
> a refactoring of the crypto stats (commit 0a742389bcc0, "crypto: acomp - Count
> error stats differently"), so it seems appropriate to remove it for now.
>
> If you could go through my patch and explain what other unused code related to
> the crypto stats you might consider to be "infrastructure" that should not be
> removed, that would be helpful.

Hi Eric,
that user is mm/zswap [1], apologize it was not in crypto tree. I guess you might
just need a new version to keep that one :-)

[1] https://lore.kernel.org/linux-mm/[email protected]/

> - Eric

Thanks
Barry


2024-03-13 02:29:25

by Eric Biggers

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the crypto tree

On Wed, Mar 13, 2024 at 10:04:28AM +0800, Herbert Xu wrote:
> On Tue, Mar 12, 2024 at 07:01:12PM -0700, Eric Biggers wrote:
> >
> > The only user of comp_alg_common was the crypto stats, and it was introduced by
> > a refactoring of the crypto stats (commit 0a742389bcc0, "crypto: acomp - Count
> > error stats differently"), so it seems appropriate to remove it for now.
> >
> > If you could go through my patch and explain what other unused code related to
> > the crypto stats you might consider to be "infrastructure" that should not be
> > removed, that would be helpful.
>
> The first patch should only remove code directly related to
> STATS. Any removal of code that is rendered useless should
> be done in one or more subsequent patches.
>
> Thanks,

comp_alg_common was part of the implementation of STATS.

I'll do the best I can to interpret your request, but if you could actually
review my original patch and let me know if there are any other specific changes
you'd like besides keeping comp_alg_common, that would be helpful as then maybe
the next version won't get reverted.

- Eric

2017-11-06 05:41:31

by Herbert Xu

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the crypto tree

On Mon, Nov 06, 2017 at 11:25:21AM +1100, Stephen Rothwell wrote:
> Hi Herbert,
>
> After merging the crypto tree, today's linux-next build (arm
> multi_v7_defconfig) failed like this:
>
> drivers/crypto/marvell/marvell-cesa: struct platform_device_id is 24 bytes. The last of 1 is:
> 0x6d 0x76 0x5f 0x63 0x72 0x79 0x70 0x74 0x6f 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
> FATAL: drivers/crypto/marvell/marvell-cesa: struct platform_device_id is not terminated with a NULL entry!
>
> Caused by commit
>
> 7b0c3d693ce6 ("crypto: marvell - Add a platform_device_id table")
>
> I have used the crypto tree from next-20171103 for today.

Thanks Stephen. I've got a patch that should fix this.

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

From 1583274274010155830@xxx Mon Nov 06 00:26:50 +0000 2017
X-GM-THRID: 1583274274010155830
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread