Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2317037rwb; Thu, 29 Sep 2022 08:44:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM63gQUw+tHLFCK0EZRagoHLXVaxsZCMsFvCI+AjmH6In5SYQu+KJUFaNUHu6Tx8HsTS5PZ/ X-Received: by 2002:a63:85c2:0:b0:43a:dff6:d42d with SMTP id u185-20020a6385c2000000b0043adff6d42dmr3428221pgd.519.1664466269806; Thu, 29 Sep 2022 08:44:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1664466269; cv=pass; d=google.com; s=arc-20160816; b=TAjAHDVjkClGHlpJSgEI3ZlJYjNUzk+rN2Ji5ZR5gqm6Y8tYa99k7fuhUsTD5a1kNl jOVoVIhqvDHaK1vgoAy2PMBzsSSvnjzZ2IuMFoFwBH+0V60SHSES0DBqLpL+UpSrda2G MexPPFzwGUgJB2EeAl/2+5OKF1SlZCC5o6GY8S5kYUG5l3POC2bOqHC5XzfhnxOJgcJQ P1MJwHYp0uGidzs30lL425qNnxE0uM7ngmLrK4KKAH3Wytm/qesK4Jh233ATi4LNVlBs wk9YNBndtG5fhDbylM7o2Ex0vT9yI3C+HG7LWxX7udDSrtM4IrmjjBq9XYZiHO11AuXS 9n3g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=PXFoZX88IwGLUDd4tLsrnL+xC/zHVOHDTLSyxHBYdVg=; b=1Hxwtu0s+a2EUuGqEUXP1uo0Oasqn+6JYpGNm8e547lTJD/7azdVvQ6QyB84KnQqZ6 wgOAmsAiDjwr7tHSSPDSa2IV/7GG3BhfSlUl0KoZyvtrvj4FfVWnnfjxPUpfk/ais5Rm es/DUOuCSFGi3xNt2lz9V3Z763wVJytF1RVgoeeACmY2s68G7A7E0JzhsR0kcgugTzTp f3mN/hRIm5EMrCPUSwhpCEpx2+Z2WweGrQdUCE4YkTrmdJ42dgENHQXHpwhpWl6q++H9 JChd3G4/fghDL1S0sMnyjtLPWeaTrgyc7YSlJxIAS2ZkeT9cgM3hhI9PniLCEs1BFFI0 4zBA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=EXuuQgB5; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lk5-20020a17090b33c500b00200e221e9a0si6477375pjb.149.2022.09.29.08.44.18; Thu, 29 Sep 2022 08:44:29 -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=@amd.com header.s=selector1 header.b=EXuuQgB5; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235770AbiI2Pja (ORCPT + 99 others); Thu, 29 Sep 2022 11:39:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234315AbiI2PjN (ORCPT ); Thu, 29 Sep 2022 11:39:13 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2081.outbound.protection.outlook.com [40.107.93.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B7D41D6D34 for ; Thu, 29 Sep 2022 08:37:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iagBf/QlSncgaJf9mynGHziiDJioDfT9ZQBhIl+9I65LhsqP9Ktsn2aFBiB7Y0/3sPp1+WzXeDmhwy6c7VJbtUY7Bu6F/T6d918sz8kvWkaMdVnxoP/bTrqWJP0/8xHCpv1yrCVp/4ifme+NsHshrdQ27Fyj7DgVA7f+3x9O146/ciVIL6RKw/gTnqqP69Ao1BQUifixv6cbqv63KOm/xbDY8q61t1QBNi8JThm/AF0MlgJVp+O8oj138PS8y6r2mp4F0ku5EttPT0IyqOaF9REuu8TwM5u6Zz9Clk35fx8688WWLsk2b3Ezy64aQtlD9KS9dh4iFIf69MiRuYG36w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PXFoZX88IwGLUDd4tLsrnL+xC/zHVOHDTLSyxHBYdVg=; b=ambIBqNRCr+T7aUvBmG7YniUmHKlEXI0wnC+3kYz7mgK6VnHuTleyIQZwM772yMtqzjUfYkVI2jUW7p6Hnndiv15jQb2+JX4yzzXeXEsrNm2mU3iJgodL5P5Np7mPtJn8J2z0nbGtdz+DqIQ9ScACEUP5lgJ+++c/Tl/18njE8MMmmN+h3ix8HsqBO85CH5Qg3WyAhYXmBAlblSgv20TKtfjwJBx09Nhrsh+Z9HWw5oafkntkgR9i13REm8Jav8tCgIaLAy0Fgj4L3evzEIUYA6kQN6snRewMHifLMPQqkpBJL6ij/Q9jx8gXEvCro71Xe1upR49e8n9dCiudSK+Uw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PXFoZX88IwGLUDd4tLsrnL+xC/zHVOHDTLSyxHBYdVg=; b=EXuuQgB5wEs1e/Rx3PEyH23kHI5LdMfyGz955kJVUB1CCUCLow77KNPhIFLIqcsm/C6SoDpM4k4RJQjO8Qhhujz797Q3qV2CSBKlN+KxpOvdgm14Ret+jb9js1wLvkP1rJ5vK8iMndfdOBelqac4bBXIU7/1gfWsaZUbpL/6iss= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BN9PR12MB5115.namprd12.prod.outlook.com (2603:10b6:408:118::14) by LV2PR12MB6013.namprd12.prod.outlook.com (2603:10b6:408:171::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.20; Thu, 29 Sep 2022 15:36:29 +0000 Received: from BN9PR12MB5115.namprd12.prod.outlook.com ([fe80::3de4:456f:800d:e013]) by BN9PR12MB5115.namprd12.prod.outlook.com ([fe80::3de4:456f:800d:e013%5]) with mapi id 15.20.5676.020; Thu, 29 Sep 2022 15:36:29 +0000 Message-ID: <13763d3b-bf7f-aaff-3bcd-60e69df86820@amd.com> Date: Thu, 29 Sep 2022 11:36:26 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] drm/amd/display: fix array-bounds error in dc_stream_remove_writeback() Content-Language: en-US To: "Pillai, Aurabindo" , "Mahfooz, Hamza" , "linux-kernel@vger.kernel.org" Cc: "Wang, Chao-kai (Stylon)" , "dri-devel@lists.freedesktop.org" , "Li, Sun peng (Leo)" , Po-Yu Hsieh Paul , "Pan, Xinhui" , "Siqueira, Rodrigo" , "amd-gfx@lists.freedesktop.org" , David Airlie , "Hung, Alex" , "Lee, Alvin" , "Deucher, Alexander" , "Wu, Hersen" , "Ma, Leo" , Jimmy Kizito , "Koenig, Christian" , "Kotarac, Pavle" References: <20220927191200.216488-1-hamza.mahfooz@amd.com> From: Felix Kuehling In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: YT4PR01CA0014.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d1::6) To BN9PR12MB5115.namprd12.prod.outlook.com (2603:10b6:408:118::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN9PR12MB5115:EE_|LV2PR12MB6013:EE_ X-MS-Office365-Filtering-Correlation-Id: fb83329c-b0d1-4984-cb10-08daa2306092 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: whtSRxZnqhh6Bv4sZ7ohdN0/c8Vj0PzQmHtFWQagyjVKKrhF1y3KuAIDJx3XQxpDoJczja3DcLHCwAd5rpI12KxrMDxnccQOPjczKBcFgOiH/OhpaASoj7GhCJ6DSKPuwfZsxVaw5JuTIYGCvrEV9ASCuBBYuIIJ4f4p0Nbklhq0SZCMzdJWXK4TncLGibKi+z55r0eyW4LfOwSlTqAUZcnGyF+beJAEraj3520rbkdI3TViJQyO2D8n2n8c8FgzTI0aF2unfVbS/yf/u7CIr3HwiLyzuTvdxfhSqOjWubvc0xWDBaKRWnWEM41l8QzI7R66tLCcC2aQfc2gMkwHRk4/N48l3caRIGQeTNWxtXH5gkOcRJ5H6KMtQ1xnRsb4Phr4iRzQm/qnOoS+Zvj4o5/zvOnKjuaUVgxy54YjBLmjj5gQh+5r5+ByOIexgYL2TT29PlzW6u47IG3dtw7+9h4X/0qsWtCZcD3Mbxp9+vaMyOXlJ9KiMXDQnh0beiAN1ws96/4ivt+ZkNQ78ODk1CO4zGfyT0M1YSqyqQU4GEA45RAvi0TQQ09QH4JpbO9ddIudWX7h6Oh2iCYgjE84uJKRqFw0q6LFgFIWobL3mkmqOZ9C/KEkdSvKYXovJ0eBpQJIGYQxXB+Cybl10qcsDMXlrWSrBLL8qgEdCC7dCeftrWflwkCX7xdH5AghGwI17NNerjDv1vTTZGPaF9A40JmWHaHZ+wL1LGIrR9qns7iP1EYnmrKSw0Bd5J6lIcXsPY9cEzIrav6usflVYG5vXz8uxReTSETOiDz4pgRMGJ8= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN9PR12MB5115.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(366004)(396003)(376002)(346002)(39860400002)(136003)(451199015)(86362001)(31696002)(36756003)(38100700002)(316002)(110136005)(4326008)(8676002)(54906003)(44832011)(66946007)(5660300002)(2906002)(8936002)(66476007)(41300700001)(66556008)(186003)(83380400001)(6666004)(478600001)(2616005)(6506007)(6486002)(26005)(6512007)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dnNMZVEzOTJUa0luVGdJQlVFcXE0bmEvNnVwNTJnU2VpcHBoQWJ4QnhVMmps?= =?utf-8?B?ZmViWUVoK0Q2SnlCUml1YWJyVlpWL3pqQ2xBOVdNZC80SVo5aUYyanpsT2Ra?= =?utf-8?B?RFVZcmtzV2FVZGpqYnQxeDRKVlpSUE44b2JYc2RwUFJpQ3ZjMHFQek1odTgw?= =?utf-8?B?K2tUdm8zek40bDdvVklnWTV0djJrdkpXNUVJZXBJdlJOTkFibU9reHJRTFhD?= =?utf-8?B?V0JkYkV4VFpOQnNNRzdFazR4MG56cmNCWG83VitWaVpucWt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YXdBTTlUKzFUN1BPNCtzQ3Iwdml6NzFTSUhhbVNCWDNnWXVQeWEw?= =?utf-8?Q?IcLzAdmR9XCuyyB7BtPj+UsO3?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: fb83329c-b0d1-4984-cb10-08daa2306092 X-MS-Exchange-CrossTenant-AuthSource: BN9PR12MB5115.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 15:36:29.1052 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: p4rPpUDsM9000wVG8cMYut8bcQhqE8ORCv1sechJYldZBONRj4Gs+1heRp5fCLRqUyNKSTM7/aiIT14RcgKhGg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB6013 X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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 I'm still seeing a warning even with this fix: /home/fkuehlin/compute/kernel/drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c: In function ?dc_stream_remove_writeback?: /home/fkuehlin/compute/kernel/drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:527:55: warning: array subscript 1 is above array bounds of ?struct dc_writeback_info[1]? [-Warray-bounds] 527 | stream->writeback_info[j] = stream->writeback_info[i]; | ~~~~~~~~~~~~~~~~~~~~~~^~~ Regards,   Felix Am 2022-09-27 um 16:35 schrieb Pillai, Aurabindo: > > [AMD Official Use Only - General] > > > [AMD Official Use Only - General] > > > Reviewed-by: Aurabindo Pillai > > -- > > Regards, > Jay > ------------------------------------------------------------------------ > *From:* Mahfooz, Hamza > *Sent:* Tuesday, September 27, 2022 3:12 PM > *To:* linux-kernel@vger.kernel.org > *Cc:* Mahfooz, Hamza ; Wentland, Harry > ; Li, Sun peng (Leo) ; > Siqueira, Rodrigo ; Deucher, Alexander > ; Koenig, Christian > ; Pan, Xinhui ; David > Airlie ; Daniel Vetter ; Lee, Alvin > ; Hung, Alex ; Kotarac, Pavle > ; Wang, Chao-kai (Stylon) > ; Pillai, Aurabindo ; > Ma, Leo ; Wu, Hersen ; Po-Yu > Hsieh Paul ; Jimmy Kizito ; > amd-gfx@lists.freedesktop.org ; > dri-devel@lists.freedesktop.org > *Subject:* [PATCH] drm/amd/display: fix array-bounds error in > dc_stream_remove_writeback() > Address the following error: > drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c: In function > ‘dc_stream_remove_writeback’: > drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:527:55: > error: array subscript [0, 0] is outside array bounds of ‘struct > dc_writeback_info[1]’ [-Werror=array-bounds] >   527 | stream->writeback_info[j] = stream->writeback_info[i]; >       | ~~~~~~~~~~~~~~~~~~~~~~^~~ > In file included from > ./drivers/gpu/drm/amd/amdgpu/../display/dc/dc.h:1269, >                  from > ./drivers/gpu/drm/amd/amdgpu/../display/dc/inc/core_types.h:29, >                  from > ./drivers/gpu/drm/amd/amdgpu/../display/dc/basics/dc_common.h:29, >                  from > drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:27: > ./drivers/gpu/drm/amd/amdgpu/../display/dc/dc_stream.h:241:34: note: > while referencing ‘writeback_info’ >   241 |         struct dc_writeback_info writeback_info[MAX_DWB_PIPES]; >       | > > Currently, we aren't checking to see if j remains within > writeback_info[]'s bounds. So, add a check to make sure that we aren't > overflowing the buffer. > > Signed-off-by: Hamza Mahfooz > --- >  drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 2 +- >  1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c > b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c > index 3ca1592ce7ac..ae13887756bf 100644 > --- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c > +++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c > @@ -520,7 +520,7 @@ bool dc_stream_remove_writeback(struct dc *dc, >          } > >          /* remove writeback info for disabled writeback pipes from > stream */ > -       for (i = 0, j = 0; i < stream->num_wb_info; i++) { > +       for (i = 0, j = 0; i < stream->num_wb_info && j < > MAX_DWB_PIPES; i++) { >                  if (stream->writeback_info[i].wb_enabled) { >                          if (i != j) >                                  /* trim the array */ > -- > 2.37.2 >