Package: cups-daemon
Version: 2.4.2-3+deb12u10
Severity: grave
Tags: patch upstream regression
X-Debbugs-Cc: [email protected], [email protected]
Dear Maintainer,
since DLA-4952-1 (cups 2.4.2-3+deb12u10), cupsd crashes as soon as it
starts a job whose options contain whitespace. In our case that was
printing a PDF named "Rechnung 215123 vom 24.11.2026-2.pdf" from
evince.
The client sees the connection drop without a response, and no job is
left in the queue:
kernel: cupsd[3719]: segfault at 5637c6372000 ip 00005637a48acfd7
sp 00007ffd91f30b40 error 6 in cupsd[5637a487a000+4c000]
The fault address is a write at a page boundary. Mapped to the source
with debug symbols from an identical rebuild: cupsdContinueJob(),
scheduler/job.c:4107 (get_options(), inlined).
Cause: debian/patches/CVE-2026-34980.patch (upstream 8d0f51cac24c,
"Filter out control characters from option values") changes the
text/name loop in get_options() to
for (valptr = attr->values[i].string.text; *valptr;)
{
if (isspace(*valptr & 255))
{
*optptr++ = ' '; /* valptr is not advanced */
}
else if ((*valptr & 255) >= ' ' && *valptr != 0x7f)
{
...
*optptr++ = *valptr++;
}
}
On whitespace, valptr is never advanced. cupsd writes spaces past the
end of the options buffer until it segfaults. (A control character
would loop forever without writing.)
Upstream fixed this in later commits that were not included in
deb12u10:
da0ff58c041f Fix get_options regression (Issue #1532)
e966de6dc87e Fix escaping of spaces in options (Issue #1630)
3f2bdc293243 Fix filter PPD keyword processing (Issue #1562)
(second hunk of the same patch: the keyword pointer is
never advanced in update_job(), so only the first PPD:
keyword is applied, repeatedly)
The attached patches (the three commits, scheduler/ only) apply on top
of CVE-2026-34980.patch. With them applied (tested on two bookworm
machines), cupsd no longer crashes and the job prints.
Related deb12u10 regressions: #1155899 (cupsd segfault, @OWNER without
local account), #1155907 (libcups2: GTK print dialog hang).
Regards,
Peter Schlaile
From: Michael R Sweet <[email protected]>
Subject: Fix escaping of spaces in options (Issue #1630)
Restore escaping of whitespace in option values passed to filters.
Origin: upstream, https://github.com/OpenPrinting/cups/commit/e966de6dc87e
Bug: https://github.com/OpenPrinting/cups/issues/1630
Forwarded: not-needed
Last-Update: 2026-11-30
diff --git a/scheduler/job.c b/scheduler/job.c
index 4229d45b88..faa052797f 100644
--- a/scheduler/job.c
+++ b/scheduler/job.c
@@ -4152,10 +4152,19 @@ get_options(cupsd_job_t *job, /* I - Job */
if (isspace(*valptr & 255))
{
+ /*
+ * Escape whitespace...
+ */
+
+ *optptr++ = '\\';
*optptr++ = ' ';
}
else if ((*valptr & 255) >= ' ' && *valptr != 0x7f)
{
+ /*
+ * Escape other special characters as needed...
+ */
+
if (strchr("\\\'\"", *valptr))
*optptr++ = '\\';
*optptr++ = *valptr;
From: Michael R Sweet <[email protected]>
Subject: Fix filter PPD keyword processing (Issue #1562)
Advance the keyword pointer when copying PPD: keywords from filters.
Origin: upstream, https://github.com/OpenPrinting/cups/commit/3f2bdc293243
Bug: https://github.com/OpenPrinting/cups/issues/1562
Forwarded: not-needed
Last-Update: 2026-11-30
diff --git a/scheduler/job.c b/scheduler/job.c
index 7cc7195ef0..f097515918 100644
--- a/scheduler/job.c
+++ b/scheduler/job.c
@@ -5415,7 +5415,7 @@ update_job(cupsd_job_t *job) /* I - Job to check */
keywords = NULL;
num_keywords = cupsParseOptions(message, 0, &keywords);
- for (i = 0, keyword = keywords; i < num_keywords; i ++)
+ for (i = 0, keyword = keywords; i < num_keywords; i ++, keyword ++)
{
/*
* Filter out "special" PPD keywords...
From: Michael R Sweet <[email protected]>
Subject: Fix get_options regression (Issue #1532)
CVE-2026-34980.patch never advances valptr for whitespace in text/name
option values, so cupsd writes spaces past the options buffer and
segfaults (any job whose options contain a space, e.g. a file name).
Origin: upstream, https://github.com/OpenPrinting/cups/commit/da0ff58c041f
Bug: https://github.com/OpenPrinting/cups/issues/1532
Forwarded: not-needed
Last-Update: 2026-11-30
diff --git a/scheduler/job.c b/scheduler/job.c
index 064e6c1c2a..7cc7195ef0 100644
--- a/scheduler/job.c
+++ b/scheduler/job.c
@@ -4120,7 +4120,7 @@ get_options(cupsd_job_t *job, /* I - Job */
case IPP_TAG_CHARSET :
case IPP_TAG_LANGUAGE :
case IPP_TAG_URI :
- for (valptr = attr->values[i].string.text; *valptr;)
+ for (valptr = attr->values[i].string.text; *valptr; valptr ++)
{
/*
* Convert tabs and newlines to spaces, filter out control chars,
@@ -4135,7 +4135,7 @@ get_options(cupsd_job_t *job, /* I - Job */
{
if (strchr("\\\'\"", *valptr))
*optptr++ = '\\';
- *optptr++ = *valptr++;
+ *optptr++ = *valptr;
}
}