2019-08-06 02:16:28

by Stephen Rothwell

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

Hi all,

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

In file included from <command-line>:
include/linux/module_signature.h:32:2: error: unknown type name 'u8'
u8 algo; /* Public-key crypto algorithm [0] */
^~
include/linux/module_signature.h:33:2: error: unknown type name 'u8'
u8 hash; /* Digest algorithm [0] */
^~
include/linux/module_signature.h:34:2: error: unknown type name 'u8'
u8 id_type; /* Key identifier type [PKEY_ID_PKCS7] */
^~
include/linux/module_signature.h:35:2: error: unknown type name 'u8'
u8 signer_len; /* Length of signer's name [0] */
^~
include/linux/module_signature.h:36:2: error: unknown type name 'u8'
u8 key_id_len; /* Length of key identifier [0] */
^~
include/linux/module_signature.h:37:2: error: unknown type name 'u8'
u8 __pad[3];
^~
include/linux/module_signature.h:38:2: error: unknown type name '__be32'
__be32 sig_len; /* Length of signature data */
^~~~~~
include/linux/module_signature.h:41:54: error: unknown type name 'size_t'
int mod_check_sig(const struct module_signature *ms, size_t file_len,
^~~~~~
include/linux/module_signature.h:41:54: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
include/linux/module_signature.h:1:1:
+#include <stddef.h>
/* SPDX-License-Identifier: GPL-2.0+ */
include/linux/module_signature.h:41:54:
int mod_check_sig(const struct module_signature *ms, size_t file_len,
^~~~~~

Caused by commit

c8424e776b09 ("MODSIGN: Export module signature definitions")

We now have build time checks to make sure that include files are self
contained.

I have added the following fix patch for today.

From: Stephen Rothwell <[email protected]>
Date: Tue, 6 Aug 2019 12:09:36 +1000
Subject: [PATCH] MODSIGN: make new include file self contained

Signed-off-by: Stephen Rothwell <[email protected]>
---
include/linux/module_signature.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/include/linux/module_signature.h b/include/linux/module_signature.h
index 523617fc5b6a..7eb4b00381ac 100644
--- a/include/linux/module_signature.h
+++ b/include/linux/module_signature.h
@@ -9,6 +9,8 @@
#ifndef _LINUX_MODULE_SIGNATURE_H
#define _LINUX_MODULE_SIGNATURE_H

+#include <linux/types.h>
+
/* In stripped ARM and x86-64 modules, ~ is surprisingly rare. */
#define MODULE_SIG_STRING "~Module signature appended~\n"

--
2.20.1

--
Cheers,
Stephen Rothwell


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

2019-08-06 03:19:34

by Thiago Jung Bauermann

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


Hello Stephen,

Stephen Rothwell <[email protected]> writes:

> Hi all,
>
> After merging the integrity tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
>
> In file included from <command-line>:
> include/linux/module_signature.h:32:2: error: unknown type name 'u8'
> u8 algo; /* Public-key crypto algorithm [0] */
> ^~
> include/linux/module_signature.h:33:2: error: unknown type name 'u8'
> u8 hash; /* Digest algorithm [0] */
> ^~
> include/linux/module_signature.h:34:2: error: unknown type name 'u8'
> u8 id_type; /* Key identifier type [PKEY_ID_PKCS7] */
> ^~
> include/linux/module_signature.h:35:2: error: unknown type name 'u8'
> u8 signer_len; /* Length of signer's name [0] */
> ^~
> include/linux/module_signature.h:36:2: error: unknown type name 'u8'
> u8 key_id_len; /* Length of key identifier [0] */
> ^~
> include/linux/module_signature.h:37:2: error: unknown type name 'u8'
> u8 __pad[3];
> ^~
> include/linux/module_signature.h:38:2: error: unknown type name '__be32'
> __be32 sig_len; /* Length of signature data */
> ^~~~~~
> include/linux/module_signature.h:41:54: error: unknown type name 'size_t'
> int mod_check_sig(const struct module_signature *ms, size_t file_len,
> ^~~~~~
> include/linux/module_signature.h:41:54: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
> include/linux/module_signature.h:1:1:
> +#include <stddef.h>
> /* SPDX-License-Identifier: GPL-2.0+ */
> include/linux/module_signature.h:41:54:
> int mod_check_sig(const struct module_signature *ms, size_t file_len,
> ^~~~~~
>
> Caused by commit
>
> c8424e776b09 ("MODSIGN: Export module signature definitions")
>
> We now have build time checks to make sure that include files are self
> contained.
>
> I have added the following fix patch for today.
>
> From: Stephen Rothwell <[email protected]>
> Date: Tue, 6 Aug 2019 12:09:36 +1000
> Subject: [PATCH] MODSIGN: make new include file self contained
>
> Signed-off-by: Stephen Rothwell <[email protected]>
> ---
> include/linux/module_signature.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/include/linux/module_signature.h b/include/linux/module_signature.h
> index 523617fc5b6a..7eb4b00381ac 100644
> --- a/include/linux/module_signature.h
> +++ b/include/linux/module_signature.h
> @@ -9,6 +9,8 @@
> #ifndef _LINUX_MODULE_SIGNATURE_H
> #define _LINUX_MODULE_SIGNATURE_H
>
> +#include <linux/types.h>
> +
> /* In stripped ARM and x86-64 modules, ~ is surprisingly rare. */
> #define MODULE_SIG_STRING "~Module signature appended~\n"

Sorry for the trouble. I wasn't aware of that build time check.
I'll enable HEADER_TEST and KERNEL_HEADER_TEST for my next patches.

Thanks for providing the fix. Should I post a new version or can Mimi
squash the above into the original patch?

--
Thiago Jung Bauermann
IBM Linux Technology Center

2019-08-06 03:46:58

by Stephen Rothwell

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

Hi Thiago,

On Tue, 06 Aug 2019 00:18:06 -0300 Thiago Jung Bauermann <[email protected]> wrote:
>
> Sorry for the trouble. I wasn't aware of that build time check.
> I'll enable HEADER_TEST and KERNEL_HEADER_TEST for my next patches.

I do allmodconfig builds which enable those.

> Thanks for providing the fix. Should I post a new version or can Mimi
> squash the above into the original patch?

Up to Mimi, but either works (or just committing my patch if the tree is
normally not rebased).

--
Cheers,
Stephen Rothwell


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

2019-08-06 19:03:26

by Mimi Zohar

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

Hi Stephen,

On Tue, 2019-08-06 at 13:45 +1000, Stephen Rothwell wrote:
> Hi Thiago,
>
> On Tue, 06 Aug 2019 00:18:06 -0300 Thiago Jung Bauermann <[email protected]> wrote:
> >
> > Sorry for the trouble. I wasn't aware of that build time check.
> > I'll enable HEADER_TEST and KERNEL_HEADER_TEST for my next patches.

ditto

>
> I do allmodconfig builds which enable those.
>
> > Thanks for providing the fix. Should I post a new version or can Mimi
> > squash the above into the original patch?
>
> Up to Mimi, but either works (or just committing my patch if the tree is
> normally not rebased).

Based on the new "Documentation/maintainer/rebasing-and-merging.rst",
I'm under the impression that we shouldn't be rebasing, even for
"just" adding tags.  Waiting for tags before pushing out to next-
integrity is causing delays, but we're trying out this approach.  So
for now, I've included your commit.

thanks,

Mimi