Package: libcups2
Version: 2.4.2-3+deb12u10
Severity: important
Tags: patch upstream regression
Control: affects -1 evince atril libgtk-3-0
X-Debbugs-Cc: [email protected], [email protected]
Dear Maintainer,
after the DLA-4952-1 update (cups 2.4.2-3+deb12u10), opening the print
dialog in evince on bookworm freezes the application at 100% CPU. It
has to be killed. cupsd itself is fine.
strace shows an endless loop without any read():
poll([{fd=12, events=POLLIN}], 1, 0) = 1 ([{fd=12, revents=POLLIN}])
poll([{fd=12, events=POLLIN}], 1, 0) = 1 ([{fd=12, revents=POLLIN}])
...
fd 12 is the Unix socket to cupsd. It holds the complete, unread
response (Recv-Q 1222). The cupsd debug log shows the request was
answered normally:
[Client 2] Returning IPP successful-ok for CUPS-Get-Printers (no URI)
from localhost.
Backtrace of the main thread:
#0 poll (nfds=1, timeout=0)
#1 _httpWait () from libcups.so.2
#2 ?? () from .../printbackends/libprintbackend-cups.so
#3 gtk_cups_request_read_write () from .../libprintbackend-cups.so
#4 ?? () from .../libprintbackend-cups.so
#5 g_main_context_check () from libglib-2.0.so.0
Cause: debian/patches/CVE-2025-58436.patch (upstream 5d414f1f91bd)
changes _httpUpdate() to wait for a complete line on non-blocking
connections. However, it only reads more data while the buffer is
already non-empty:
if (http->used > 0 && !memchr(...) && (size_t)http->used <
sizeof(http->buffer))
With an empty buffer it returns HTTP_STATUS_CONTINUE without reading.
The GTK print backend therefore polls forever. Upstream fixed this in
2.4.16 with commit 2dc021f33a3e "Fix an infinite loop issue in GTK+"
(https://github.com/OpenPrinting/cups/issues/1439). That follow-up was
not included in deb12u10.
This is the same issue as #1121906 and #1121908 in unstable (fixed in
2.4.16-1).
The attached patch (upstream 2dc021f33a3e, cups/http.c only) applies
after CVE-2025-58436.patch. With it applied on top of deb12u10
(tested on two bookworm machines), the print dialog opens normally
again and jobs are submitted.
(Jobs whose options contain spaces then crash cupsd; that is a separate
deb12u10 regression in CVE-2026-34980.patch, reported separately.)
Related deb12u10 regression in cupsd: #1155899.
Regards,
Peter Schlaile
From: Michael R Sweet <[email protected]>
Subject: Fix an infinite loop issue in GTK+ (Issue #1439)
CVE-2025-58436.patch makes _httpUpdate() wait for a complete line on
non-blocking connections, but it only reads more data when the buffer
already holds something. With an empty buffer it reports
HTTP_STATUS_CONTINUE without reading, so callers polling for the
response (GTK print backend: evince, atril, papers) spin forever at
100% CPU.
Origin: upstream, https://github.com/OpenPrinting/cups/commit/2dc021f33a3e
Bug: https://github.com/OpenPrinting/cups/issues/1439
Bug-Debian: https://bugs.debian.org/1121906
Forwarded: not-needed
Last-Update: 2026-11-30
diff --git a/cups/http.c b/cups/http.c
index 214e451585..31ed6ddc15 100644
--- a/cups/http.c
+++ b/cups/http.c
@@ -2779,7 +2779,7 @@ _httpUpdate(http_t *http, /* I - HTTP connection */
/* See whether our read buffer is full... */
DEBUG_printf(("2_httpUpdate: used=%d", http->used));
- if (http->used > 0 && !memchr(http->buffer, '\n', (size_t)http->used) && (size_t)http->used < sizeof(http->buffer))
+ if (http->used < sizeof(http->buffer))
{
/* No, try filling in more data... */
if ((bytes = http_read(http, http->buffer + http->used, sizeof(http->buffer) - (size_t)http->used, /*timeout*/0)) > 0)