Skip to contentSkip to conversation

selinux: don't use make's grouped targets feature yet

PATCH In review Paul Moore 3 participants 6 messages Jun 1, 2023 – Jun 2, 2023 SELinux security module

lore
Share & tools
lore

Paul Moore

author maintainer
#0 lore raw

PATCH 1/1 selinux: don't use make's grouped targets feature yet

The Linux Kernel currently only requires make v3.82 while the grouped target functionality requires make v4.3. Removed the grouped target introduced in 4ce1f694eb5d ("selinux: ensure av_permissions.h is built when needed") as well as the multiple header file targets in the make rule. This effectively reverts the problem commit.

We will revisit this change when make >= 4.3 is required by the rest of the kernel.

Fixes 4ce1f694eb5d ("selinux: ensure av_permissions.h is built when needed")
---
 security/selinux/Makefile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
security/selinux/Makefile +5 -1
index 0aecf9334ec3..8b21520bd4b9 100644
@@ -26,5 +26,9 @@ quiet_cmd_flask = GEN     $(obj)/flask.h $(obj)/av_permissions.h
       cmd_flask = $< $(obj)/flask.h $(obj)/av_permissions.h
 
 targets += flask.h av_permissions.h
-$(obj)/flask.h $(obj)/av_permissions.h &: scripts/selinux/genheaders/genheaders FORCE
+# once make >= 4.3 is required, we can use grouped targets in the rule below,
+# which basically involves adding both headers and a '&' before the colon, see
+# the example below:
+#   $(obj)/flask.h $(obj)/av_permissions.h &: scripts/selinux/...
+$(obj)/flask.h: scripts/selinux/genheaders/genheaders FORCE
 	$(call if_changed,flask)
Signature · 1 line
2.40.1
author maintainer
#1 lore raw
Quoted 10 lines · Paul Moore

The Linux Kernel currently only requires make v3.82 while the grouped target functionality requires make v4.3. Removed the grouped target introduced in 4ce1f694eb5d ("selinux: ensure av_permissions.h is built when needed") as well as the multiple header file targets in the make rule. This effectively reverts the problem commit.

We will revisit this change when make >= 4.3 is required by the rest of the kernel.

Quoted 8 lines
Fixes 4ce1f694eb5d ("selinux: ensure av_permissions.h is built when needed")
---
 security/selinux/Makefile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

As indicated by the -stable tag above, this is intended for the selinux/stable-6.4 branch, with backports to the affected -stable trees expected once this hits Linus' tree.

The SELinux folks will likely note that a different patch will be needed for selinux/next, you can expect that shortly, I just wanted to make sure we fixed Linus' tree first.

Signature · 1 line
paul-moore.com
Tested-by on v1 1/1
#2 lore raw
In reply to Paul Moore
Quoted 11 lines · Paul Moore

The Linux Kernel currently only requires make v3.82 while the grouped target functionality requires make v4.3. Removed the grouped target introduced in 4ce1f694eb5d ("selinux: ensure av_permissions.h is built when needed") as well as the multiple header file targets in the make rule. This effectively reverts the problem commit.

We will revisit this change when make >= 4.3 is required by the rest of the kernel.

Note for -stable: this is needed in all kernels that backported commit 4ce1f694eb5d

Thanks, Paul!

Quoted 28 lines
Fixes 4ce1f694eb5d ("selinux: ensure av_permissions.h is built when needed")
---
  security/selinux/Makefile | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)
security/selinux/Makefile +5 -2
index 0aecf9334ec3..8b21520bd4b9 100644
@@ -26,5 +26,9 @@ quiet_cmd_flask = GEN     $(obj)/flask.h $(obj)/av_permissions.h
        cmd_flask = $< $(obj)/flask.h $(obj)/av_permissions.h
 
  targets += flask.h av_permissions.h
-$(obj)/flask.h $(obj)/av_permissions.h &: scripts/selinux/genheaders/genheaders FORCE
+# once make >= 4.3 is required, we can use grouped targets in the rule below,
+# which basically involves adding both headers and a '&' before the colon, see
+# the example below:
+#   $(obj)/flask.h $(obj)/av_permissions.h &: scripts/selinux/...
+$(obj)/flask.h: scripts/selinux/genheaders/genheaders FORCE
         $(call if_changed,flask)
--

2.40.1

author maintainer
#3 lore raw
Quoted 8 lines · Luiz Capitulino
Quoted 7 lines · Paul Moore

The Linux Kernel currently only requires make v3.82 while the grouped target functionality requires make v4.3. Removed the grouped target introduced in 4ce1f694eb5d ("selinux: ensure av_permissions.h is built when needed") as well as the multiple header file targets in the make rule. This effectively reverts the problem commit.

Quoted 4 lines
Quoted 2 lines

We will revisit this change when make >= 4.3 is required by the rest of the kernel.

Great, thanks for the help. I'm going to merge this into selinux/stable-6.4 and send it up to Linus as soon as the testing with that is done (should be later tonight).

Quoted 4 lines

Note for -stable: this is needed in all kernels that backported commit 4ce1f694eb5d

Thanks, Paul!

Signature · 1 line
paul-moore.com
Tested-by on v1 1/1
#4 lore raw
In reply to Paul Moore

Le 01/06/2023 à 20:06, Paul Moore a écrit :

Quoted 6 lines

The Linux Kernel currently only requires make v3.82 while the grouped target functionality requires make v4.3. Removed the grouped target introduced in 4ce1f694eb5d ("selinux: ensure av_permissions.h is built when needed") as well as the multiple header file targets in the make rule. This effectively reverts the problem commit.

Quoted 8 lines

We will revisit this change when make >= 4.3 is required by the rest of the kernel.

Fixes 4ce1f694eb5d ("selinux: ensure av_permissions.h is built when needed")

Thanks for the patch & the quick exchange we had around this issue.

Erwan,

author maintainer
#5 lore raw
Quoted 10 lines · Erwan Velu
Quoted 9 lines · Paul Moore

The Linux Kernel currently only requires make v3.82 while the grouped target functionality requires make v4.3. Removed the grouped target introduced in 4ce1f694eb5d ("selinux: ensure av_permissions.h is built when needed") as well as the multiple header file targets in the make rule. This effectively reverts the problem commit.

We will revisit this change when make >= 4.3 is required by the rest of the kernel.

Quoted 7 lines
Quoted 5 lines
Fixes 4ce1f694eb5d ("selinux: ensure av_permissions.h is built when needed")

Thanks for the patch & the quick exchange we had around this issue.

Thanks for your help with identification and testing! I just saw that Linus merged this into his tree, so I would expect this to start making its way to the -stable trees soon.

Signature · 1 line
paul-moore.com