summaryrefslogtreecommitdiffstats
path: root/bsp/meta-synopsys/recipes-core/systemd
diff options
context:
space:
mode:
Diffstat (limited to 'bsp/meta-synopsys/recipes-core/systemd')
-rw-r--r--bsp/meta-synopsys/recipes-core/systemd/files/0001-network-fix-static-assertion-on-IPPROTO_MAX-range.patch74
-rw-r--r--bsp/meta-synopsys/recipes-core/systemd/systemd-conf.bbappend6
-rw-r--r--bsp/meta-synopsys/recipes-core/systemd/systemd-conf/0001-Add-MESA_LOADER_DRIVER_OVERRIDE-imx-drm-env-to-etc-s.patch27
-rw-r--r--bsp/meta-synopsys/recipes-core/systemd/systemd_244.3.bbappend4
4 files changed, 78 insertions, 33 deletions
diff --git a/bsp/meta-synopsys/recipes-core/systemd/files/0001-network-fix-static-assertion-on-IPPROTO_MAX-range.patch b/bsp/meta-synopsys/recipes-core/systemd/files/0001-network-fix-static-assertion-on-IPPROTO_MAX-range.patch
new file mode 100644
index 00000000..b6aeadd0
--- /dev/null
+++ b/bsp/meta-synopsys/recipes-core/systemd/files/0001-network-fix-static-assertion-on-IPPROTO_MAX-range.patch
@@ -0,0 +1,74 @@
+From c5e346905952fef0f163d91522dd43333f1f219d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
+Date: Thu, 16 Apr 2020 16:49:30 +0200
+Subject: [PATCH] network: fix static assertion on IPPROTO_MAX range
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Builds with recent glibc would fail with:
+../src/network/netdev/fou-tunnel.c: In function ‘config_parse_ip_protocol’:
+../src/basic/macro.h:380:9: error: static assertion failed: "IPPROTO_MAX-1 <= UINT8_MAX"
+ 380 | static_assert(expr, #expr)
+ | ^~~~~~~~~~~~~
+../src/network/netdev/fou-tunnel.c:161:9: note: in expansion of macro ‘assert_cc’
+ 161 | assert_cc(IPPROTO_MAX-1 <= UINT8_MAX);
+ | ^~~~~~~~~
+
+This is because f9ac84f92f151e07586c55e14ed628d493a5929d (present in
+glibc-2.31.9000-9.fc33.x86_64) added IPPROTO_MPTCP=262, following
+v5.5-rc5-1002-gfaf391c382 in the kernel.
+
+(cherry picked from commit 3d58d7328a6ecbc61d3494803d705edd8a108d72)
+---
+ src/network/netdev/fou-tunnel.c | 22 ++++++++++++++++------
+ 1 file changed, 16 insertions(+), 6 deletions(-)
+
+diff --git a/src/network/netdev/fou-tunnel.c b/src/network/netdev/fou-tunnel.c
+index 3cc273c7fe..40abacd6f7 100644
+--- a/src/network/netdev/fou-tunnel.c
++++ b/src/network/netdev/fou-tunnel.c
+@@ -149,7 +149,10 @@ int config_parse_ip_protocol(
+ void *data,
+ void *userdata) {
+
+- uint8_t *protocol = data;
++ uint8_t *ret = data;
++ unsigned protocol;
++ /* linux/fou.h defines the netlink field as one byte, so we need to reject protocols numbers that
++ * don't fit in one byte. */
+ int r;
+
+ assert(filename);
+@@ -158,11 +161,11 @@ int config_parse_ip_protocol(
+ assert(rvalue);
+ assert(data);
+
+- assert_cc(IPPROTO_MAX-1 <= UINT8_MAX);
+-
+ r = parse_ip_protocol(rvalue);
+- if (r < 0) {
+- r = safe_atou8(rvalue, protocol);
++ if (r >= 0)
++ protocol = r;
++ else {
++ r = safe_atou(rvalue, &protocol);
+ if (r < 0)
+ log_syntax(unit, LOG_ERR, filename, line, r,
+ "Failed to parse IP protocol '%s' for Foo over UDP tunnel, "
+@@ -170,7 +173,14 @@ int config_parse_ip_protocol(
+ return 0;
+ }
+
+- *protocol = r;
++ if (protocol > UINT8_MAX) {
++ log_syntax(unit, LOG_ERR, filename, line, 0,
++ "IP protocol '%s' for FooOverUDP tunnel out of range, "
++ "ignoring assignment: %m", rvalue);
++ return 0;
++ }
++
++ *ret = protocol;
+ return 0;
+ }
+
diff --git a/bsp/meta-synopsys/recipes-core/systemd/systemd-conf.bbappend b/bsp/meta-synopsys/recipes-core/systemd/systemd-conf.bbappend
deleted file mode 100644
index 6d076184..00000000
--- a/bsp/meta-synopsys/recipes-core/systemd/systemd-conf.bbappend
+++ /dev/null
@@ -1,6 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-SRC_URI += "\
- file://0001-Add-MESA_LOADER_DRIVER_OVERRIDE-imx-drm-env-to-etc-s.patch \
-"
-
-
diff --git a/bsp/meta-synopsys/recipes-core/systemd/systemd-conf/0001-Add-MESA_LOADER_DRIVER_OVERRIDE-imx-drm-env-to-etc-s.patch b/bsp/meta-synopsys/recipes-core/systemd/systemd-conf/0001-Add-MESA_LOADER_DRIVER_OVERRIDE-imx-drm-env-to-etc-s.patch
deleted file mode 100644
index d002368e..00000000
--- a/bsp/meta-synopsys/recipes-core/systemd/systemd-conf/0001-Add-MESA_LOADER_DRIVER_OVERRIDE-imx-drm-env-to-etc-s.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 37cba4c262828c9a33466e71206046dbeb151300 Mon Sep 17 00:00:00 2001
-From: Evgeniy Didin <Evgeniy.Didin@synopsys.com>
-Date: Tue, 2 Apr 2019 17:49:52 +0300
-Subject: [PATCH] Add MESA_LOADER_DRIVER_OVERRIDE=imx-drm env to
- /etc/systemd/system.conf
-
-Signed-off-by: Evgeniy Didin <Evgeniy.Didin@synopsys.com>
----
- src/core/system.conf.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/core/system.conf.in b/src/core/system.conf.in
-index f0a59a79a5..2851151ad0 100644
---- a/src/core/system.conf.in
-+++ b/src/core/system.conf.in
-@@ -38,7 +38,7 @@
- #DefaultRestartSec=100ms
- #DefaultStartLimitIntervalSec=10s
- #DefaultStartLimitBurst=5
--#DefaultEnvironment=
-+DefaultEnvironment="MESA_LOADER_DRIVER_OVERRIDE=imx-drm"
- #DefaultCPUAccounting=no
- #DefaultIOAccounting=no
- #DefaultIPAccounting=no
---
-2.16.2
-
diff --git a/bsp/meta-synopsys/recipes-core/systemd/systemd_244.3.bbappend b/bsp/meta-synopsys/recipes-core/systemd/systemd_244.3.bbappend
new file mode 100644
index 00000000..4f3c2a7c
--- /dev/null
+++ b/bsp/meta-synopsys/recipes-core/systemd/systemd_244.3.bbappend
@@ -0,0 +1,4 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+SRC_URI_append += "\
+ file://0001-network-fix-static-assertion-on-IPPROTO_MAX-range.patch; \
+"