linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: build failure after merge of the landlock tree
@ 2023-10-27  5:34 Stephen Rothwell
       [not found] ` <20231027.Soon0Gee4xul@digikod.net>
  2023-11-05 23:22 ` Stephen Rothwell
  0 siblings, 2 replies; 5+ messages in thread
From: Stephen Rothwell @ 2023-10-27  5:34 UTC (permalink / raw)
  To: Mickaël Salaün, Paul Moore
  Cc: Casey Schaufler, Kees Cook, Konstantin Meskhidze,
	Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 2248 bytes --]

Hi all,

After merging the landlock tree, today's linux-next build (powerpc
ppc64_defconfig) failed like this:

In file included from security/landlock/net.c:14:
security/landlock/net.c: In function 'landlock_add_net_hooks':
security/landlock/common.h:12:23: error: passing argument 3 of 'security_add_hooks' from incompatible pointer type [-Werror=incompatible-pointer-types]
   12 | #define LANDLOCK_NAME "landlock"
      |                       ^~~~~~~~~~
      |                       |
      |                       char *
security/landlock/net.c:199:28: note: in expansion of macro 'LANDLOCK_NAME'
  199 |                            LANDLOCK_NAME);
      |                            ^~~~~~~~~~~~~
In file included from security/landlock/setup.h:12,
                 from security/landlock/cred.h:17,
                 from security/landlock/net.c:15:
include/linux/lsm_hooks.h:120:53: note: expected 'const struct lsm_id *' but argument is of type 'char *'
  120 |                                const struct lsm_id *lsmid);
      |                                ~~~~~~~~~~~~~~~~~~~~~^~~~~

Caused by commit

  fff69fb03dde ("landlock: Support network rules with TCP bind and connect")

interacting with commit

  9b09f11320db ("LSM: Identify modules by more than name")

from the security tree.

I have applied the following merge resolution patch.

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Fri, 27 Oct 2023 16:13:32 +1100
Subject: [PATCH] fixup for "landlock: Support network rules with TCP bind and
 connect"

interacting with "LSM: Identify modules by more than name"

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 security/landlock/net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/security/landlock/net.c b/security/landlock/net.c
index aaa92c2b1f08..efa1b644a4af 100644
--- a/security/landlock/net.c
+++ b/security/landlock/net.c
@@ -196,5 +196,5 @@ static struct security_hook_list landlock_hooks[] __ro_after_init = {
 __init void landlock_add_net_hooks(void)
 {
 	security_add_hooks(landlock_hooks, ARRAY_SIZE(landlock_hooks),
-			   LANDLOCK_NAME);
+			   &landlock_lsmid);
 }
-- 
2.40.1

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: linux-next: build failure after merge of the landlock tree
       [not found] ` <20231027.Soon0Gee4xul@digikod.net>
@ 2023-10-28 15:34   ` Paul Moore
  0 siblings, 0 replies; 5+ messages in thread
From: Paul Moore @ 2023-10-28 15:34 UTC (permalink / raw)
  To: Mickaël Salaün
  Cc: Stephen Rothwell, Casey Schaufler, Kees Cook,
	Konstantin Meskhidze, Linux Kernel Mailing List,
	Linux Next Mailing List

On Fri, Oct 27, 2023 at 8:56 AM Mickaël Salaün <mic@digikod.net> wrote:
>
> Thanks Stephen, your patch is good! I tested it with the merge of my
> branch and LSM/dev-staging.
>
> The new Landlock changes (tested in -next for a few weeks) add a new
> call to security_add_hooks() which gets a new signature with commit
> 9b09f11320db ("LSM: Identify modules by more than name") from
> the LSM/dev-staging branch [1].
>
> I plan to send a PR with my branch in the next merge window (for
> v6.7-rc1).
>
> We should squash Stephen's patch in commit 9b09f11320db ("LSM:
> Identify modules by more than name") but it would not be possible
> without my branch. I see two solutions:
> * keep Stephen's patch in -next only, or
> * rebase LSM/dev-staging on my branch now, and rebase it later on
>   v6.7-rc1 once my branch is merged (which is the workflow described in
>   [1]).
>
> Paul, what do you think?

Thanks Stephen, Mickaël.

Once the Landlock tree is pulled into Linus' tree during the next
merge window I'll update the LSM syscall patches currently living in
lsm/dev-staging and this conflict should go away.  FWIW, there are
other conflicts with the LSM syscall patchset, most notably in the
syscall registrations, that should also resolve themselves when I
rebase on top of v6.7-rc1.

-- 
paul-moore.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: linux-next: build failure after merge of the landlock tree
  2023-10-27  5:34 linux-next: build failure after merge of the landlock tree Stephen Rothwell
       [not found] ` <20231027.Soon0Gee4xul@digikod.net>
@ 2023-11-05 23:22 ` Stephen Rothwell
  1 sibling, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2023-11-05 23:22 UTC (permalink / raw)
  To: Mickaël Salaün, Paul Moore
  Cc: Casey Schaufler, Kees Cook, Konstantin Meskhidze,
	Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 2515 bytes --]

Hi all,

On Fri, 27 Oct 2023 16:34:00 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> After merging the landlock tree, today's linux-next build (powerpc
> ppc64_defconfig) failed like this:
> 
> In file included from security/landlock/net.c:14:
> security/landlock/net.c: In function 'landlock_add_net_hooks':
> security/landlock/common.h:12:23: error: passing argument 3 of 'security_add_hooks' from incompatible pointer type [-Werror=incompatible-pointer-types]
>    12 | #define LANDLOCK_NAME "landlock"
>       |                       ^~~~~~~~~~
>       |                       |
>       |                       char *
> security/landlock/net.c:199:28: note: in expansion of macro 'LANDLOCK_NAME'
>   199 |                            LANDLOCK_NAME);
>       |                            ^~~~~~~~~~~~~
> In file included from security/landlock/setup.h:12,
>                  from security/landlock/cred.h:17,
>                  from security/landlock/net.c:15:
> include/linux/lsm_hooks.h:120:53: note: expected 'const struct lsm_id *' but argument is of type 'char *'
>   120 |                                const struct lsm_id *lsmid);
>       |                                ~~~~~~~~~~~~~~~~~~~~~^~~~~
> 
> Caused by commit
> 
>   fff69fb03dde ("landlock: Support network rules with TCP bind and connect")
> 
> interacting with commit
> 
>   9b09f11320db ("LSM: Identify modules by more than name")
> 
> from the security tree.
> 
> I have applied the following merge resolution patch.
> 
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Fri, 27 Oct 2023 16:13:32 +1100
> Subject: [PATCH] fixup for "landlock: Support network rules with TCP bind and
>  connect"
> 
> interacting with "LSM: Identify modules by more than name"
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  security/landlock/net.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/security/landlock/net.c b/security/landlock/net.c
> index aaa92c2b1f08..efa1b644a4af 100644
> --- a/security/landlock/net.c
> +++ b/security/landlock/net.c
> @@ -196,5 +196,5 @@ static struct security_hook_list landlock_hooks[] __ro_after_init = {
>  __init void landlock_add_net_hooks(void)
>  {
>  	security_add_hooks(landlock_hooks, ARRAY_SIZE(landlock_hooks),
> -			   LANDLOCK_NAME);
> +			   &landlock_lsmid);
>  }
> -- 
> 2.40.1

This is now a conflict between the security tree and Linus' tree.
-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: linux-next: build failure after merge of the landlock tree
  2023-06-06  3:02 Stephen Rothwell
@ 2023-06-06  7:39 ` Mickaël Salaün
  0 siblings, 0 replies; 5+ messages in thread
From: Mickaël Salaün @ 2023-06-06  7:39 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Konstantin Meskhidze, Linux Kernel Mailing List, Linux Next Mailing List

Hi Stephen,

I only checked this branch with a previous kernel version. It is now 
fixed and pushed.

Thanks,
  Mickaël


On 06/06/2023 05:02, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the landlock tree, today's linux-next build (powerpc
> ppc64_defconfig) failed like this:
> 
> security/landlock/net.c:165:51: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__lsm_ro_after_init'
>    165 | static struct security_hook_list landlock_hooks[] __lsm_ro_after_init = {
>        |                                                   ^~~~~~~~~~~~~~~~~~~
> security/landlock/net.c: In function 'landlock_add_net_hooks':
> security/landlock/net.c:172:28: error: 'landlock_hooks' undeclared (first use in this function)
>    172 |         security_add_hooks(landlock_hooks, ARRAY_SIZE(landlock_hooks),
>        |                            ^~~~~~~~~~~~~~
> security/landlock/net.c:172:28: note: each undeclared identifier is reported only once for each function it appears in
> In file included from include/linux/container_of.h:5,
>                   from include/linux/kernel.h:21,
>                   from include/linux/uio.h:8,
>                   from include/linux/socket.h:8,
>                   from include/uapi/linux/in.h:25,
>                   from include/linux/in.h:19,
>                   from security/landlock/net.c:9:
> include/linux/build_bug.h:16:51: error: bit-field '<anonymous>' width not an integer constant
>     16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
>        |                                                   ^
> include/linux/compiler.h:231:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
>    231 | #define __must_be_array(a)      BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
>        |                                 ^~~~~~~~~~~~~~~~~
> include/linux/kernel.h:56:59: note: in expansion of macro '__must_be_array'
>     56 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
>        |                                                           ^~~~~~~~~~~~~~~
> security/landlock/net.c:172:44: note: in expansion of macro 'ARRAY_SIZE'
>    172 |         security_add_hooks(landlock_hooks, ARRAY_SIZE(landlock_hooks),
>        |                                            ^~~~~~~~~~
> security/landlock/net.c: At top level:
> security/landlock/net.c:157:12: warning: 'hook_socket_connect' defined but not used [-Wunused-function]
>    157 | static int hook_socket_connect(struct socket *const sock,
>        |            ^~~~~~~~~~~~~~~~~~~
> security/landlock/net.c:150:12: warning: 'hook_socket_bind' defined but not used [-Wunused-function]
>    150 | static int hook_socket_bind(struct socket *const sock,
>        |            ^~~~~~~~~~~~~~~~
> 
> Caused by commit
> 
>    6d0bfdb25ce6 ("landlock: Add network rules and TCP hooks support")
> 
> I have use the landlock tree from next-20230605 for today.
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* linux-next: build failure after merge of the landlock tree
@ 2023-06-06  3:02 Stephen Rothwell
  2023-06-06  7:39 ` Mickaël Salaün
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Rothwell @ 2023-06-06  3:02 UTC (permalink / raw)
  To: Mickaël Salaün
  Cc: Konstantin Meskhidze, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 2728 bytes --]

Hi all,

After merging the landlock tree, today's linux-next build (powerpc
ppc64_defconfig) failed like this:

security/landlock/net.c:165:51: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__lsm_ro_after_init'
  165 | static struct security_hook_list landlock_hooks[] __lsm_ro_after_init = {
      |                                                   ^~~~~~~~~~~~~~~~~~~
security/landlock/net.c: In function 'landlock_add_net_hooks':
security/landlock/net.c:172:28: error: 'landlock_hooks' undeclared (first use in this function)
  172 |         security_add_hooks(landlock_hooks, ARRAY_SIZE(landlock_hooks),
      |                            ^~~~~~~~~~~~~~
security/landlock/net.c:172:28: note: each undeclared identifier is reported only once for each function it appears in
In file included from include/linux/container_of.h:5,
                 from include/linux/kernel.h:21,
                 from include/linux/uio.h:8,
                 from include/linux/socket.h:8,
                 from include/uapi/linux/in.h:25,
                 from include/linux/in.h:19,
                 from security/landlock/net.c:9:
include/linux/build_bug.h:16:51: error: bit-field '<anonymous>' width not an integer constant
   16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
      |                                                   ^
include/linux/compiler.h:231:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
  231 | #define __must_be_array(a)      BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
      |                                 ^~~~~~~~~~~~~~~~~
include/linux/kernel.h:56:59: note: in expansion of macro '__must_be_array'
   56 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
      |                                                           ^~~~~~~~~~~~~~~
security/landlock/net.c:172:44: note: in expansion of macro 'ARRAY_SIZE'
  172 |         security_add_hooks(landlock_hooks, ARRAY_SIZE(landlock_hooks),
      |                                            ^~~~~~~~~~
security/landlock/net.c: At top level:
security/landlock/net.c:157:12: warning: 'hook_socket_connect' defined but not used [-Wunused-function]
  157 | static int hook_socket_connect(struct socket *const sock,
      |            ^~~~~~~~~~~~~~~~~~~
security/landlock/net.c:150:12: warning: 'hook_socket_bind' defined but not used [-Wunused-function]
  150 | static int hook_socket_bind(struct socket *const sock,
      |            ^~~~~~~~~~~~~~~~

Caused by commit

  6d0bfdb25ce6 ("landlock: Add network rules and TCP hooks support")

I have use the landlock tree from next-20230605 for today.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-11-05 23:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-27  5:34 linux-next: build failure after merge of the landlock tree Stephen Rothwell
     [not found] ` <20231027.Soon0Gee4xul@digikod.net>
2023-10-28 15:34   ` Paul Moore
2023-11-05 23:22 ` Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2023-06-06  3:02 Stephen Rothwell
2023-06-06  7:39 ` Mickaël Salaün

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).