Skip to contentSkip to conversation

package/linux-headers: prevent invalid custom headers selection

PATCH Applied James Hilliard 3 participants 3 messages May 2, 2022 – May 28, 2022

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/linux-headers: prevent invalid custom headers selection

If BR2_KERNEL_HEADERS_AS_KERNEL is selected and the kernel version is known we should not allow potentially incompatible custom headers to be selected.

For BR2_LINUX_KERNEL_LATEST_CIP_VERSION and BR2_LINUX_KERNEL_LATEST_CIP_RT_VERSION this means we should select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_10 and for BR2_LINUX_KERNEL_LATEST_VERSION this means we should select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_15.

Fixes:
- http://autobuild.buildroot.net/results/816/816d7a3ad77ba051fff7fba7f2a38fc31549c360
- http://autobuild.buildroot.net/results/3c3/3c3a9fc1a1e0002ae8169fd47b3003ebb86935f6
- http://autobuild.buildroot.net/results/188/18883459577dc0fdc01149110ffb81bf1a28c94a

---
Changes v1 -> v2:
- entirely disable Custom kernel headers series when kernel version is known

---
 linux/Config.in                      | 3 +++
 package/linux-headers/Config.in.host | 5 +++--
 2 files changed, 6 insertions(+), 2 deletions(-)
linux/Config.in +3 -0
index 4b4ea8d92b..82f5675f6c 100644
@@ -29,9 +29,11 @@ choice
 
 config BR2_LINUX_KERNEL_LATEST_VERSION
 	bool "Latest version (5.15)"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_15 if BR2_KERNEL_HEADERS_AS_KERNEL
 
 config BR2_LINUX_KERNEL_LATEST_CIP_VERSION
 	bool "Latest CIP SLTS version (5.10.104-cip3)"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_10 if BR2_KERNEL_HEADERS_AS_KERNEL
 	help
 	  CIP launched in the spring of 2016 to address the needs of
 	  organizations in industries such as power generation and
@@ -51,6 +53,7 @@ config BR2_LINUX_KERNEL_LATEST_CIP_VERSION
 
 config BR2_LINUX_KERNEL_LATEST_CIP_RT_VERSION
 	bool "Latest CIP RT SLTS version (5.10.104-cip3-rt3)"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_10 if BR2_KERNEL_HEADERS_AS_KERNEL
 	help
 	  Same as the CIP version, but this is the PREEMPT_RT realtime
 	  variant.
package/linux-headers/Config.in.host +3 -2
index decf02d175..43a116974b 100644
@@ -127,8 +127,9 @@ endif
 
 choice
 	bool "Custom kernel headers series"
-	default BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_15 if \
-		(BR2_KERNEL_HEADERS_AS_KERNEL && BR2_LINUX_KERNEL_LATEST_VERSION)
+	depends on !BR2_LINUX_KERNEL_LATEST_VERSION || !BR2_KERNEL_HEADERS_AS_KERNEL
+	depends on !BR2_LINUX_KERNEL_LATEST_CIP_VERSION || !BR2_KERNEL_HEADERS_AS_KERNEL
+	depends on !BR2_LINUX_KERNEL_LATEST_CIP_RT_VERSION || !BR2_KERNEL_HEADERS_AS_KERNEL
 	depends on BR2_KERNEL_HEADERS_VERSION || BR2_KERNEL_HEADERS_AS_KERNEL || \
 		   BR2_KERNEL_HEADERS_CUSTOM_TARBALL || BR2_KERNEL_HEADERS_CUSTOM_GIT
 	help
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 10 lines · James Hilliard

If BR2_KERNEL_HEADERS_AS_KERNEL is selected and the kernel version is known we should not allow potentially incompatible custom headers to be selected.

For BR2_LINUX_KERNEL_LATEST_CIP_VERSION and BR2_LINUX_KERNEL_LATEST_CIP_RT_VERSION this means we should select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_10 and for BR2_LINUX_KERNEL_LATEST_VERSION this means we should select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_15.

Quoted 6 lines

Fixes:
- http://autobuild.buildroot.net/results/816/816d7a3ad77ba051fff7fba7f2a38fc31549c360
- http://autobuild.buildroot.net/results/3c3/3c3a9fc1a1e0002ae8169fd47b3003ebb86935f6
- http://autobuild.buildroot.net/results/188/18883459577dc0fdc01149110ffb81bf1a28c94a

Applied to master, thanks.

Regards,
Arnout

Quoted 38 lines

---
Changes v1 -> v2:
- entirely disable Custom kernel headers series when kernel version is known

---
  linux/Config.in                      | 3 +++
  package/linux-headers/Config.in.host | 5 +++--
  2 files changed, 6 insertions(+), 2 deletions(-)
linux/Config.in +3 -0
index 4b4ea8d92b..82f5675f6c 100644
@@ -29,9 +29,11 @@ choice
 
  config BR2_LINUX_KERNEL_LATEST_VERSION
  	bool "Latest version (5.15)"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_15 if BR2_KERNEL_HEADERS_AS_KERNEL
 
  config BR2_LINUX_KERNEL_LATEST_CIP_VERSION
  	bool "Latest CIP SLTS version (5.10.104-cip3)"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_10 if BR2_KERNEL_HEADERS_AS_KERNEL
  	help
  	  CIP launched in the spring of 2016 to address the needs of
  	  organizations in industries such as power generation and
@@ -51,6 +53,7 @@ config BR2_LINUX_KERNEL_LATEST_CIP_VERSION
 
  config BR2_LINUX_KERNEL_LATEST_CIP_RT_VERSION
  	bool "Latest CIP RT SLTS version (5.10.104-cip3-rt3)"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_10 if BR2_KERNEL_HEADERS_AS_KERNEL
  	help
  	  Same as the CIP version, but this is the PREEMPT_RT realtime
  	  variant.
package/linux-headers/Config.in.host +0 -0
index decf02d175..43a116974b 100644
@@ -127,8 +127,9 @@ endif
 

package/linux-headers/Config.in.host endif · line 135

Quoted 10 lines
package/linux-headers/Config.in.host +3 -2
  choice
  	bool "Custom kernel headers series"
-	default BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_15 if \
-		(BR2_KERNEL_HEADERS_AS_KERNEL && BR2_LINUX_KERNEL_LATEST_VERSION)
+	depends on !BR2_LINUX_KERNEL_LATEST_VERSION || !BR2_KERNEL_HEADERS_AS_KERNEL
+	depends on !BR2_LINUX_KERNEL_LATEST_CIP_VERSION || !BR2_KERNEL_HEADERS_AS_KERNEL
+	depends on !BR2_LINUX_KERNEL_LATEST_CIP_RT_VERSION || !BR2_KERNEL_HEADERS_AS_KERNEL
  	depends on BR2_KERNEL_HEADERS_VERSION || BR2_KERNEL_HEADERS_AS_KERNEL || \
  		   BR2_KERNEL_HEADERS_CUSTOM_TARBALL || BR2_KERNEL_HEADERS_CUSTOM_GIT
  	help

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw
In reply to James Hilliard
Quoted 17 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"James" == James Hilliard <[email protected]> writes:

If BR2_KERNEL_HEADERS_AS_KERNEL is selected and the kernel version is known we should not allow potentially incompatible custom headers to be selected.

For BR2_LINUX_KERNEL_LATEST_CIP_VERSION and BR2_LINUX_KERNEL_LATEST_CIP_RT_VERSION this means we should select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_10 and for BR2_LINUX_KERNEL_LATEST_VERSION this means we should select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_15.

Fixes:
- http://autobuild.buildroot.net/results/816/816d7a3ad77ba051fff7fba7f2a38fc31549c360
- http://autobuild.buildroot.net/results/3c3/3c3a9fc1a1e0002ae8169fd47b3003ebb86935f6
- http://autobuild.buildroot.net/results/188/18883459577dc0fdc01149110ffb81bf1a28c94a

Quoted 4 lines

---
Changes v1 -> v2:
- entirely disable Custom kernel headers series when kernel version is known

Committed to 2022.02.x, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot