[packages/iotop] Rel 4. Don't crash on non-UTF-8 bytes in /proc/PID/cmdline.

arekm arekm at pld-linux.org
Thu Oct 29 08:37:52 CET 2026


commit 647caed19b33c17287b743082979b5020056b7dc
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Oct 29 00:41:33 2026 +0100

    Rel 4. Don't crash on non-UTF-8 bytes in /proc/PID/cmdline.

 iotop.spec     |  8 +++++---
 non-utf8.patch | 27 +++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 3 deletions(-)
---
diff --git a/iotop.spec b/iotop.spec
index 0f7f052..5a59a6c 100644
--- a/iotop.spec
+++ b/iotop.spec
@@ -3,18 +3,19 @@ Summary(hu.UTF-8):	Top-szerű program I/O-hoz
 Summary(pl.UTF-8):	Narzędzie podobne do topa dla I/O
 Name:		iotop
 Version:	0.6
-Release:	3
+Release:	4
 License:	GPL v2
 Group:		Applications/System
 Source0:	http://guichaz.free.fr/iotop/files/%{name}-%{version}.tar.bz2
 # Source0-md5:	5ef9456b26d7694abf3101a72e1e0d1d
 Patch0:		status-value-error.patch
 Patch1:		python3.patch
+Patch2:		non-utf8.patch
 URL:		http://guichaz.free.fr/iotop/
 BuildRequires:	python3-devel
+BuildRequires:	python3-setuptools
 BuildRequires:	rpm-pythonprov
-BuildRequires:	rpmbuild(macros) >= 1.219
-Requires:	python3
+BuildRequires:	rpmbuild(macros) >= 1.714
 Requires:	python3-modules
 Requires:	uname(release) >= 2.6.20
 BuildArch:	noarch
@@ -42,6 +43,7 @@ wyświetlającym, dla których procesów wykonywane są operacje we/wy.
 %setup -q
 %patch -P 0 -p1
 %patch -P 1 -p1
+%patch -P 2 -p1
 
 %build
 %py3_build
diff --git a/non-utf8.patch b/non-utf8.patch
new file mode 100644
index 0000000..7df00d9
--- /dev/null
+++ b/non-utf8.patch
@@ -0,0 +1,27 @@
+Don't crash with UnicodeDecodeError on non-UTF-8 bytes in /proc/PID/cmdline
+and /proc/PID/status (both user-controlled).
+
+Upstream commits:
+https://repo.or.cz/iotop.git/commit/443737ec620a699286b9b2e44dbcaac53f553812
+https://repo.or.cz/iotop.git/commit/4b2e1aa2464cfc4a29c9565c9e143b52ef8e4848
+
+--- iotop-0.6.orig/iotop/data.py	2026-10-29 00:39:54.816695809 +0100
++++ iotop-0.6/iotop/data.py	2026-10-29 00:40:00.067147477 +0100
+@@ -192,7 +192,7 @@
+ def parse_proc_pid_status(pid):
+     result_dict = {}
+     try:
+-        for line in open('/proc/%d/status' % pid):
++        for line in open('/proc/%d/status' % pid, errors='replace'):
+             key, value = line.split(':\t', 1)
+             result_dict[key] = value.strip()
+     except (IOError, ValueError):
+@@ -285,7 +285,7 @@
+     def get_cmdline(self):
+         # A process may exec, so we must always reread its cmdline
+         try:
+-            proc_cmdline = open('/proc/%d/cmdline' % self.pid)
++            proc_cmdline = open('/proc/%d/cmdline' % self.pid, errors='replace')
+             cmdline = proc_cmdline.read(4096)
+         except IOError:
+             return '{no such process}'
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/iotop.git/commitdiff/647caed19b33c17287b743082979b5020056b7dc



More information about the pld-cvs-commit mailing list