Debian Patches

Status for needrestart/3.11-1.1~deb13u2

Patch Description Author Forwarded Bugs Origin Last update
01-use-invoke-rc-d.diff # Use invoke-rc.d instead of service command.
# Closes: #850948

diff -Naur needrestart-2.11.orig/needrestart needrestart-2.11/needrestart
no
03-ignore-serial-getty.diff do not restart serial-getty@*.service Helmut Grohne <helmut@subdivi.de> invalid
08-uninitialized-vars-arm.diff # Patch from George Robbert <ghr@minazuki.org> to fix uninitialized value
# warnings on some amd64 and arm systems.
# Closes: #1063719

===================================================================
no
10-notify-send-timeout.diff # Add patch from Michał Mirosław <mirq-deboogs@rere.qmqm.pl> to fix a timeout
# in notify-send.
# Closes: #1024426
# Additional fixed later:
# Closes: #1079666

diff -Naur needrestart-3.6.orig/ex/notify.d/400-notify-send needrestart-3.6/ex/notify.d/400-notify-send
no
notify.d-pass-the-notification-text-to-su-through-th.patch notify.d: pass the notification text to su through the environment
The 400-notify-send hook built the su -c command string from the notification title and body. The body contains the process names that needrestart reports, and a process sets its own 15 byte comm name with prctl(PR_SET_NAME). A name that closes the quote and adds shell syntax was therefore executed by the shell that su starts, instead of being shown as text.

The title and body are now stored in NR_NOTIFY_TITLE and NR_NOTIFY_BODY, exported, and expanded by the inner shell as quoted data, so the command string no longer contains any notification text. The existing MSGTITLE and MSGBODY variables are renamed instead of being copied into new ones, so there is no second copy of the text to keep in sync.

Found and reported privately by Armaan Sandhu.
[Salvatore Bonaccorso: Backport for Debian which switches from su invocation to runuser,
in 10-notify-send-timeout.diff patch]
Armaan Sandhu <armaan.sandhu0504@gmail.com> no https://github.com/liske/needrestart/commit/b1996a1a6e2b22fbfdf3062d06712b0a49a99d73 2026-10-23
needrestart-anchor-the-systemd-cgroup-matches.patch needrestart: anchor the systemd cgroup matches
needrestart files a process under a user session, a user manager or a user service by matching the path in /proc/PID/cgroup. Those matches were not anchored at the start, so a directory with the right name created inside a user's own delegated user@UID.service cgroup could give a process a different uid. A process started by one user could be filed under root's session, and the notification hook then ran su as root with that process name.

The session, user manager and user service matches now only accept paths that begin with systemd's slice components before the user-N.slice, user@N.service or session scope. Paths that match the systemd layout are classified as before, and paths that only contain the same text inside a user-owned subtree no longer match.

This was tested against systemd layouts only. Hosts whose cgroup paths have a different prefix, such as some container setups, may classify those processes differently.

Found and reported privately by Armaan Sandhu.
Armaan Sandhu <armaan.sandhu0504@gmail.com> no https://github.com/liske/needrestart/commit/7874c082c86f041512b01a02860a89b463524684 2026-10-23
needrestart-replace-non-ASCII-and-control-characters.patch needrestart: replace non-ASCII and control characters in process names

Process names come from /proc and can contain escape sequences and newlines. They were printed to the terminal unchanged, which allowed terminal escape injection in the process list shown to the administrator. A newline in a name could also split a line of the machine readable NEEDRESTART-PID output.

Only printable ASCII characters (0x20 to 0x7e) are now kept in the displayed copies and in the text passed to notification hooks. Every other byte is replaced with ?, so control characters and the bytes of UTF-8 encoded names are covered by one simple rule. A name with non-ASCII letters therefore shows one ? per byte. That is a deliberate trade-off: the rule is easy to read and cannot miss an escape that is encoded as UTF-8. The stored process names are not changed.

Found and reported privately by Armaan Sandhu.
Armaan Sandhu <armaan.sandhu0504@gmail.com> no https://github.com/liske/needrestart/commit/e8ae1f22f16b0b6023f86af0bcfdd88277f8ecec 2026-10-23

All known versions for source package 'needrestart'

Links