public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python3-lxc] f43: Add upstream patch to fix "random" personality corruption.
@ 2026-09-27 15:12 Thomas Moschny
  0 siblings, 0 replies; only message in thread
From: Thomas Moschny @ 2026-09-27 15:12 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/python3-lxc
Branch : f43
Commit : 0b9d3ebd28e5256271a1ffe3fdefb1e9bf721134
Author : Thomas Moschny <thm@fedoraproject.org>
Date   : 2026-09-27T17:03:42+02:00
Stats  : +72/-2 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/python3-lxc/c/0b9d3ebd28e5256271a1ffe3fdefb1e9bf721134?branch=f43

Log:
Add upstream patch to fix "random" personality corruption.

---
diff --git a/lxc-5.0.0_fix_personality_corruption.patch b/lxc-5.0.0_fix_personality_corruption.patch
new file mode 100644
index 0000000..74644e2
--- /dev/null
+++ b/lxc-5.0.0_fix_personality_corruption.patch
@@ -0,0 +1,65 @@
+From f8d5ddc6892db7c1c7007c09c67b2230887163f4 Mon Sep 17 00:00:00 2001
+From: Thomas Jarosch <thomas.jarosch@intra2net.com>
+Date: Mon, 16 Jun 2025 20:22:47 +0200
+Subject: [PATCH] Fix random "personality" corruption when linking against lxc
+ 6
+
+When using python3-lxc with liblxc from lxc 6.0.x, we could observe
+random systemd startup failures on containers.
+
+systemd will report this on startup when the corruption hit:
+"Warning! Reported kernel version 2.6.74-300.fc42.x86_64 is older than systemd's required baseline kernel version 4.15. Your mileage may vary."
+
+Some systemd services fail to start properly, including systemd-journald.
+
+The root problem is that other lxc library code unexpectedly calls into
+lxc_config_parse_arch() from python3-lxc instead of the function from liblxc.
+
+The function signature of lxc_config_parse_arch() changed throughout the years
+and the second "persona" pointer argument was added. The older python3-lxc copy
+of the function would not initialize the provided memory location of "persona".
+It will therefore contain a random value.
+
+Additionally the symbol visibility of liblxc's lxc_config_parse_arch()
+changed with this commit in lxc 6.0:
+
+******************************************
+commit 42eeffcb05c468fd7b3a90eeda4a3abe9f26844b
+AuthorDate: Sun Feb 18 15:43:20 2024 +0100
+
+    confile: unhide lxc_config_parse_arch() helper
+
+    Looks safe enough to be available for liblxc users.
+******************************************
+
+This results in two symbols with the same name and
+the python3-lxc symbol takes precedence.
+
+Fix the issue by making the function static in python3-lxc,
+so python3-lxc stays compatible with lxc 5.x and 6.x.
+
+A future python3-lxc version might remove the local function
+and use lxc_config_parse_arch() from liblxc 6.0 and later.
+
+Side quest: Even though lxc 5.0 already has the "persona" function argument in
+lxc_config_parse_arch() since 7c43fa56e70c65607f63dec8ff5a9682a3091ab2 (from 2021),
+it is not affected since the symbol visibility is still hidden.
+
+Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
+---
+ lxc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lxc.c b/lxc.c
+index 3039cfc..bc31eb1 100644
+--- a/lxc.c
++++ b/lxc.c
+@@ -81,7 +81,7 @@ static int lxc_wait_for_pid_status(pid_t pid)
+ }
+ 
+ /* Copied from lxc/confile.c, with HAVE_SYS_PERSONALITY_H check removed */
+-signed long lxc_config_parse_arch(const char *arch)
++static signed long lxc_config_parse_arch(const char *arch)
+ {
+     struct per_name {
+         char *name;

diff --git a/python3-lxc.spec b/python3-lxc.spec
index b942da0..5b13012 100644
--- a/python3-lxc.spec
+++ b/python3-lxc.spec
@@ -1,13 +1,15 @@
 Name:           python3-lxc
 Version:        5.0.0
-Release:        19%{?dist}
+Release:        20%{?dist}
 Summary:        Python binding for LXC
 # Automatically converted from old format: LGPLv2+ - review is highly recommended.
 License:        LicenseRef-Callaway-LGPLv2+
 URL:            https://linuxcontainers.org/lxc
 Source0:        https://linuxcontainers.org/downloads/lxc/%{name}-%{version}.tar.gz
 # see https://github.com/lxc/python3-lxc/issues/35
-Patch0:         lxc-5.0.0_py3.13.patch
+Patch:          lxc-5.0.0_py3.13.patch
+# see https://github.com/lxc/python3-lxc/pull/38
+Patch:          lxc-5.0.0_fix_personality_corruption.patch
 BuildRequires:  python%{python3_pkgversion}-devel
 BuildRequires:  lxc-devel >= 3.0.0
 BuildRequires:  pkgconfig
@@ -67,6 +69,9 @@ sed -i -e '1 s@^#!.*@#!%{__python3}@' examples/*.py
 
 
 %changelog
+* Sun Sep 27 2026 Thomas Moschny <thomas.moschny@gmx.de> - 5.0.0-20
+- Add upstream patch to fix "random" personality corruption.
+
 * Wed Jul 22 2026 Python Maint <python-maint@redhat.com> - 5.0.0-19
 - Rebuilt for Python 3.15.0b4 ABI change
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-27 15:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-27 15:12 [rpms/python3-lxc] f43: Add upstream patch to fix "random" personality corruption Thomas Moschny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox