Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3322542rwa; Tue, 23 Aug 2022 02:49:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR5GpoadmpUQKooC552YES7Maj3iIPrEzxCxsg+WPjygcIHAsA6LqyPMuOO4s3CwaPJ+gROt X-Received: by 2002:a17:907:7355:b0:73d:a1b5:12bc with SMTP id dq21-20020a170907735500b0073da1b512bcmr1094440ejc.451.1661248163490; Tue, 23 Aug 2022 02:49:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661248163; cv=none; d=google.com; s=arc-20160816; b=HsUVJlrm32U4tIdFGhchWlvOljA+/PbrYD8hNae1Q+uPsHMJ3toc/SZbwVRb1v0hGa UzBuXNROgL9DmbCPawQ3W10niLfGkQ8fR7mo/7t2xxAWOJcgTGG/nPNaMOu52myYvF0l ceozVs/z7L5x1pGLXmslA0COiw3cskgwvILCOgQ3x8WvmpW+WBX9ODz53ne7KrWwfHYS GNq6/GmIXANgRJs2hi49K27qM8tq4e8D0J2iscAxklGOqBhxx4ZLHLYS4C92oNCxD4J2 ORS/Sg3ajJPd6rPnCfoRP3xqZJVK7gl3kbH5G8mYSiS8GF8VQGcODJ9G5wQ7qNtKI0w8 Q+Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5Oiko5WpzZqHKXeWqCsxXT+ZtvBxTP2iXs13BYLAYhU=; b=fvkOmUgz5m0edXnPS6O0KhiSPLyY3hO78wByOmQTE81jY05fVoV9xvdUe+M4DDr/Yj T++YoXOCHnVmzGLIqtto6WCa0KvFGoL6dZPDe86JULU5sZeZIdtp4/qmigkAFWToY50s 6jSmq+uQQHHEsAILMfz8w6qMJzu9bCTCbjYqSWCt/DVrBnCcm//HDa3M1IwhU+H8hhFu QjPTIWFz4l2hMkLXPiR1s9oVoMGaPya4bGLXNpL72NKCF3HjLE3kYsTI0oT0cOm6yS1/ VSF9dDWwRMXmx1afRNLRPtgVkK4zwCBUr7P6lrBJ6WwKphBmT7OtE9JvCjhv+dIcu0pB n4EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JV9EUYsX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id tl24-20020a170907c31800b0072a6d845d91si9204837ejc.159.2022.08.23.02.48.57; Tue, 23 Aug 2022 02:49:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JV9EUYsX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351212AbiHWJgx (ORCPT + 99 others); Tue, 23 Aug 2022 05:36:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351348AbiHWJf3 (ORCPT ); Tue, 23 Aug 2022 05:35:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FB4E9751C; Tue, 23 Aug 2022 01:39:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A21E461326; Tue, 23 Aug 2022 08:38:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4711C433C1; Tue, 23 Aug 2022 08:38:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661243924; bh=jW7R1X5fVt9SZ7CcWc7egTN9A/dldQ6+CaJL5v2cE9A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JV9EUYsXKNOdmICIsOdK2j6UP+lgZKXrYyteU483ch14j9u4xtNuk8aHHCKSSx/IZ p5B/YrYKN3ofAw1AT+IcTysfU3sIrpGcQiQYL2zWb0UZiwPxeOl6xU9x9DN6beT2b+ uL4ap2c6CKKzaFadkr/Vo/qTNDeQbB0fbctM751w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Chris Park , Rodrigo Siqueira , Tom Chung , Aurabindo Pillai , Daniel Wheeler , Alex Deucher Subject: [PATCH 5.15 009/244] drm/amd/display: Check correct bounds for stream encoder instances for DCN303 Date: Tue, 23 Aug 2022 10:22:48 +0200 Message-Id: <20220823080059.393790523@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080059.091088642@linuxfoundation.org> References: <20220823080059.091088642@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aurabindo Pillai commit 89b008222c2bf21e50219725caed31590edfd9d1 upstream. [Why & How] eng_id for DCN303 cannot be more than 1, since we have only two instances of stream encoders. Check the correct boundary condition for engine ID for DCN303 prevent the potential out of bounds access. Fixes: cd6d421e3d1a ("drm/amd/display: Initial DC support for Beige Goby") Reported-by: Dan Carpenter Cc: stable@vger.kernel.org Reviewed-by: Chris Park Reviewed-by: Rodrigo Siqueira Acked-by: Tom Chung Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c +++ b/drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c @@ -500,7 +500,7 @@ static struct stream_encoder *dcn303_str int afmt_inst; /* Mapping of VPG, AFMT, DME register blocks to DIO block instance */ - if (eng_id <= ENGINE_ID_DIGE) { + if (eng_id <= ENGINE_ID_DIGB) { vpg_inst = eng_id; afmt_inst = eng_id; } else