From patchwork Tue Dec 1 07:42:20 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rohini Sangam X-Patchwork-Id: 106758 Received: from mail-dy1-f181.google.com (mail-dy1-f181.google.com [74.125.82.181]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.6437.1796110949829069046 for ; Mon, 30 Nov 2026 23:42:29 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@mvista.com header.s=google header.b=c4a/jyVp; spf=pass (domain: mvista.com, ip: 74.125.82.181, mailfrom: rsangam@mvista.com) Received: by mail-dy1-f181.google.com with SMTP id 5a478bee46e88-386c4d2e2ccso11188780eec.0 for ; Mon, 30 Nov 2026 23:42:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mvista.com; s=google; t=1796110949; x=1796715749; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=hh6Ac8NRqUL5jqLQ16W0R/6lXFlDV5rq6GjeY3ZgLJY=; b=c4a/jyVpS/xT5O6E4WD5fyXauUnyYBfAlEL/5W9Kq5j6l1Lxxsv09azv/1Hkhpgww9 z/YXOmt04tOfztHOiUzWGNKKqhRHU54GrT2NStZDFXFHzhmV5RJR2loKJQl853pbnzQA ToAVazmeM5FGbamuLjCuDEU9oLImJ3HLQfkoA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796110949; x=1796715749; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=hh6Ac8NRqUL5jqLQ16W0R/6lXFlDV5rq6GjeY3ZgLJY=; b=XYHuzcVcoan0QlizDrrt9BePhHUQGBAL9+fuof6o6zROyEZs9ENvk7vm2JZsPzQtBB j5Ptf5RSaax7/Nx7QoEg0AiAh96vZfm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ef1 with SMTP id 5a478bee46e88-38571120627mr36443020eec.39.1796110948939; Mon, 30 Nov 2026 23:42:28 -0800 (PST) Return-Path: Received: from MVIN00040.mvista.com ([49.207.193.160]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-385c6830815sm96774125eec.20.2026.11.30.23.42.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 23:42:28 -0800 (PST) From: Rohini Sangam To: openembedded-devel@lists.openembedded.org Cc: Rohini Sangam Subject: [meta-python][scarthgap][PATCH] python3-pillow: Security fix for CVE-2026-59197.patch Date: Tue, 1 Dec 2026 13:12:20 +0530 Message-Id: <20261201074220.264375-1-rsangam@mvista.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Tue, 01 Dec 2026 07:42:39 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/133744 Pick patch from [1] also mentioned at Debian tracker in [2] [1] https://github.com/python-pillow/Pillow/commit/cce3bdb867c77a3420261ed1bfdb6b0787ec8fc1 [2] https://security-tracker.debian.org/tracker/CVE-2026-59197 Signed-off-by: Rohini Sangam --- .../python3-pillow/CVE-2026-59197.patch | 65 +++++++++++++++++++ .../python/python3-pillow_10.3.0.bb | 1 + 2 files changed, 66 insertions(+) create mode 100644 meta-python/recipes-devtools/python/python3-pillow/CVE-2026-59197.patch diff --git a/meta-python/recipes-devtools/python/python3-pillow/CVE-2026-59197.patch b/meta-python/recipes-devtools/python/python3-pillow/CVE-2026-59197.patch new file mode 100644 index 0000000000..4fc6763262 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-pillow/CVE-2026-59197.patch @@ -0,0 +1,65 @@ +From a94def348a72786e433e19dbc7c8cdd5bef02e11 Mon Sep 17 00:00:00 2001 +From: Andrew Murray +Date: Sat, 20 Jun 2026 11:53:14 +1000 +Subject: [PATCH] Validate large filter sizes when initializing RankFilter + +CVE: CVE-2026-59197 +Upstream-Status: Backport [https://github.com/python-pillow/Pillow/commit/cce3bdb867c77a3420261ed1bfdb6b0787ec8fc1] + +Signed-off-by: Rohini Sangam +--- + Tests/test_image_filter.py | 6 ++++++ + src/PIL/ImageFilter.py | 3 +++ + src/libImaging/Filter.c | 3 +++ + 3 files changed, 12 insertions(+) + +diff --git a/Tests/test_image_filter.py b/Tests/test_image_filter.py +index 47f9ffa3d..cb4c3108f 100644 +--- a/Tests/test_image_filter.py ++++ b/Tests/test_image_filter.py +@@ -132,6 +132,12 @@ def test_rankfilter_properties() -> None: + assert rankfilter.size == 1 + assert rankfilter.rank == 2 + ++ with pytest.raises(ValueError, match="filter size too large"): ++ ImageFilter.RankFilter(23171, 1) ++ im = Image.new("1", (1, 1)) ++ with pytest.raises(ValueError, match="filter size too large"): ++ im.im.expand(23171) ++ + + def test_builtinfilter_p() -> None: + builtin_filter = ImageFilter.BuiltinFilter() +diff --git a/src/PIL/ImageFilter.py b/src/PIL/ImageFilter.py +index b2c4950d6..1a64b3c98 100644 +--- a/src/PIL/ImageFilter.py ++++ b/src/PIL/ImageFilter.py +@@ -61,6 +61,9 @@ class Kernel(BuiltinFilter): + msg = "not enough coefficients in kernel" + raise ValueError(msg) + self.filterargs = size, scale, offset, kernel ++ if size * size * 4 > (2**31 - 1): ++ msg = "filter size too large" ++ raise ValueError(msg) + + + class RankFilter(Filter): +diff --git a/src/libImaging/Filter.c b/src/libImaging/Filter.c +index 4dcd368ca..f1d75fa3f 100644 +--- a/src/libImaging/Filter.c ++++ b/src/libImaging/Filter.c +@@ -57,6 +57,11 @@ ImagingExpand(Imaging imIn, int xmargin, int ymargin) { + if (xmargin < 0 && ymargin < 0) { + return (Imaging)ImagingError_ValueError("bad kernel size"); + } ++ ++ int margin = xmargin > ymargin ? xmargin : ymargin; ++ if (margin > INT_MAX / (margin * (int)sizeof(FLOAT32))) { ++ return (Imaging)ImagingError_ValueError("filter size too large"); ++ } + + imOut = ImagingNewDirty( + imIn->mode, imIn->xsize + 2 * xmargin, imIn->ysize + 2 * ymargin); +-- +2.44.4 + diff --git a/meta-python/recipes-devtools/python/python3-pillow_10.3.0.bb b/meta-python/recipes-devtools/python/python3-pillow_10.3.0.bb index 240fec967f..0b3ac947f2 100644 --- a/meta-python/recipes-devtools/python/python3-pillow_10.3.0.bb +++ b/meta-python/recipes-devtools/python/python3-pillow_10.3.0.bb @@ -14,6 +14,7 @@ SRC_URI = "git://github.com/python-pillow/Pillow.git;branch=main;protocol=https file://CVE-2026-59198.patch \ file://CVE-2026-59204.patch \ file://CVE-2026-112393.patch \ + file://CVE-2026-59197.patch \ " SRCREV = "5c89d88eee199ba53f64581ea39b6a1bc52feb1a"