From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF13F34F27B; Thu, 20 Aug 2026 15:05:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787238357; cv=none; b=MBGTkqL0sCMI1IZSv0LISo0EU/vVGNr9E6eXaZsJ1KKRP9b3JslR/m/g5FrCPtglhwbB+qieJSsJRX0pZJSoM6dvcIgII7/eMnsQINRPqhWidDwBoTUjwwb4Zt8gmDqV5qrldqIRfF9Frykkuxp1qqeaSNbAg/symyWyAgnN5lU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787238357; c=relaxed/simple; bh=aqhWZatnMIaLw1l8qFV9jE4tttBE/MLOF8TIrWh/JCc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Wxr0Rs1wLWdStN6BziwXsV6vYu0MvxNyt54h+bYxyA8m6oAPcL1CmVreSOkdtqUcNbFEkE7oACXdbwC8BW/L+seWrV0p7/BSHdHPVik+vd3lduW1eXA6FjXNziB1/iwT4VN4DESRzMaF0D17FmW3IwYIva1vkUu+OGeMY6z3XRY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=C3uKP8aR; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="C3uKP8aR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1D571F000E9; Thu, 20 Aug 2026 15:05:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1787238356; bh=tTUmIlymKu9fiunTCxrtW/71mnelOReTPal11SFJW/g=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=C3uKP8aR3azOQWqw6q7C3bDP+bma/Gu3xSgdvtJrvgczBKDoFEvvrbEtl6bNQl4z8 VnJv3Dd60I++s/cqXcSyX2W70q8ZUOGKcNLaa5vdzrTa37JLjI/0RbEeOZjeF2M5Ck 6I30bmn+SNyHFDgSFUbT9WLtmP0jizyUlB+QiKho= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, David Rosca , Leo Liu , Ruijing Dong , Alex Deucher Subject: [PATCH 7.1 119/228] drm/amdgpu: Reject UVD message with dimensions above 4096 Date: Thu, 20 Aug 2026 16:54:21 +0200 Message-ID: <20260820145248.246412089@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260820145244.450574346@linuxfoundation.org> References: <20260820145244.450574346@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: David Rosca commit 8c9aebcdd9f46f7a14b98d6ab18574b7a48fbb08 upstream. Fixes potential overflow in DPB size calculations. Signed-off-by: David Rosca Acked-by: Leo Liu Reviewed-by: Ruijing Dong Signed-off-by: Alex Deucher (cherry picked from commit 05e1387d151f71569fbe122d2c89f9db0c21dc10) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c @@ -655,8 +655,8 @@ static int amdgpu_uvd_cs_msg_decode(stru unsigned int image_size, tmp, min_dpb_size, num_dpb_buffer; unsigned int min_ctx_size = ~0; - /* Reject invalid dimensions to prevent division by zero */ - if (width < 16 || height < 16) { + /* Reject invalid dimensions */ + if (width < 16 || height < 16 || width > 4096 || height > 4096) { dev_WARN_ONCE(adev->dev, 1, "Invalid UVD decoding dimensions (%dx%d)!\n", width, height);