Fix CVE-2026-18297: opusdec channel position bounds check

Backport upstream commit 178ae5ac20db to fix CVE-2026-18297.
The patch adds a bounds check in gst_opus_dec_negotiate() to
set pos = NULL when n_channels > 64, preventing a buffer
overflow in the memcpy into the fixed-size opus_pos array.

CVE: CVE-2026-18297
Upstream patches:
 - 178ae5ac20.patch
Resolves: RHEL-246584

This commit was backported by Ymir, a Red Hat Enterprise Linux software maintenance AI agent.

Assisted-by: Ymir
This commit is contained in:
RHEL Packaging Agent 2026-08-25 07:32:57 +00:00
parent a9d216170f
commit bee2d55c97
2 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,27 @@
From a8f51eaa18a0a3c5a4ace173b8724c73c8b1646d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
Date: Fri, 19 Jun 2026 13:48:16 +0300
Subject: [PATCH] opusdec: Don't use any channel positions for >64 channels
We don't support this.
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/work_items/5122
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/12044>
---
subprojects/gst-plugins-base/ext/opus/gstopusdec.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/subprojects/gst-plugins-base/ext/opus/gstopusdec.c b/subprojects/gst-plugins-base/ext/opus/gstopusdec.c
index 03d061a..c3bfe2f 100644
--- a/subprojects/gst-plugins-base/ext/opus/gstopusdec.c
+++ b/subprojects/gst-plugins-base/ext/opus/gstopusdec.c
@@ -359,6 +359,8 @@ gst_opus_dec_negotiate (GstOpusDec * dec, const GstAudioChannelPosition * pos)
GST_DEBUG_OBJECT (dec, "Using a default of 2 channels");
dec->n_channels = 2;
pos = NULL;
+ } else if (dec->n_channels > 64) {
+ pos = NULL;
}
if (dec->sample_rate == 0) {

View File

@ -9,7 +9,7 @@
Name: gstreamer1-plugins-base
Version: 1.22.12
Release: 8%{?dist}
Release: 9%{?dist}
Summary: GStreamer streaming media framework base plugins
License: LGPL-2.1-or-later
@ -33,6 +33,9 @@ Patch008: 0008-ssaparse-Search-for-closing-brace-after-opening-brac.patch
Patch009: 0009-ssaparse-Don-t-use-strstr-on-strings-that-are-potent.patch
Patch010: 0010-subparse-Check-for-NULL-return-of-strchr-when-parsin.patch
Patch011: 0001-riff-Correctly-check-that-enough-RGB-palette-data-is.patch
# https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/12044
# https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/178ae5ac20db75e56d65e4c4bc142bb234387807
Patch012: 0001-opusdec-Don-t-use-any-channel-positions-for-64-chann.patch
BuildRequires: meson >= 0.48.0
@ -147,6 +150,7 @@ for the GStreamer Base Plugins library.
%patch -P 9 -p3
%patch -P 10 -p3
%patch -P 11 -p3
%patch -P 12 -p3
%build
%meson \
@ -522,6 +526,9 @@ chrpath --delete $RPM_BUILD_ROOT%{_bindir}/gst-play-1.0
%endif
%changelog
* Tue Aug 25 2026 RHEL Packaging Agent <redhat-ymir-agent@redhat.com> - 1.22.12-9
- Apply patch for CVE-2026-18297
* Wed Apr 01 2026 Tomas Pelka <tpelka@redhat.com> - 1.22.12-8
- Rebuild again -7 was build in wrong target