Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp382872imn; Wed, 27 Jul 2022 08:48:59 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sA8zHo21ApBeyuzqcqJ9/MhVzghoGCxX2CuwoYj/jQMymu7LU8B4gBq7qiKpMToQJcAlQP X-Received: by 2002:a63:dc56:0:b0:419:e9df:28ce with SMTP id f22-20020a63dc56000000b00419e9df28cemr19282715pgj.48.1658936939222; Wed, 27 Jul 2022 08:48:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1658936939; cv=pass; d=google.com; s=arc-20160816; b=w1YI/fuQqb7io9Gx3mhhvXh4VwjBFcVMnW7nYPdRzw+mjFTo8Hp3IFleTp0MbIgEMb ITY7C1nECox7+CAwnZ9Pk7X5YAAu/eHpbnOzb/4RVAHwOs8d1Lbb51FNv86K1HkLQVj+ pPJXCOu02Lu8yNfLS6lsS/f+ltJkfEwhYpPzZ5hK27fyRxci5PtkUSy5+hyvdZqcuZ0O 7ah7Wk/1/BrkBF+0oG3qUINZw7WyMBV2El6ei3uo1yHqRAj66/VtO+aF8DZrDl8u++79 ZKD5qpFlJLTAj+MgAlPsJlZHXZraOvIvT239Bi7/jiSjcpdqgtPKS2axtUn2iXlZbUyW 4JUg== 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=A/NuTHojEuelbf6XTENMKI8DJF7F/2DrSH7wnyREkO4=; b=T3dEpBR27Yka5WU3m/qDiGRagNo7XoxRKjv0nA+PfCFOgTHHUhF1WxJiwtrlUgG9u5 mBMbPvdsfd6keOfr2mUJChN2O+z+6cxJetom2Yd8amcCTZaCjcJAHglCX9PhKk1NApbR 1qi3OjRzQw4HsjtWItbJzUlTgDkpGsc0i5zgjMXWs7GNa4rh7PTbOwbO073IeXg5JpQC UjUTUolIH3VC0uVa2l1SC3sHmQSyx99WFUwBoSAQoAhUAC/nmKjIpFAymd8RSKNEBc6g xb2ZEyfda4y2tvhBr2m+RqkLLz/A6cObk48299hUZidslyXCC1JKSWiRLnQRMimeliGX thuA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=JV9ZBmZQ; 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 kk15-20020a17090b4a0f00b001f06deff0afsi2920705pjb.82.2022.07.27.08.48.43; Wed, 27 Jul 2022 08:48:59 -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=JV9ZBmZQ; 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 S233466AbiG0PQD (ORCPT + 99 others); Wed, 27 Jul 2022 11:16:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233153AbiG0PQA (ORCPT ); Wed, 27 Jul 2022 11:16:00 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2069.outbound.protection.outlook.com [40.107.223.69]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D18033AB02 for ; Wed, 27 Jul 2022 08:15:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j5Ry9zJ3csw3eqK7H4B7bzQ+IKLQdsNdUslJCHCYkR6MbDjLyWbq6866r1taPbzAoTU6UHGAQCa5zyj3cu7Nj0oTjQcqz+EoABgud5zmykbpGaFPsf9RUcK0LfHvLD652AqHQVX5GN/SMTbK62lQ4B16tgaFSnXnpUhP7K4An2hGK4uN2G9eiyPVp/RwHBaLPMcbTiWxLE2Ph8bdSbIqaK7oSK9fIQ7LGNqqYCUZ/B91FlyrZLqBJiKoodkXdxXmcWY3TyCtvvm1lJG+ncAXYxrG4S6EfIYM52Jk3nE0PBLYX3HU+xEmhlYx0xC+2GlFLBQlnjFsKn6jefqNT9Px2A== 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=A/NuTHojEuelbf6XTENMKI8DJF7F/2DrSH7wnyREkO4=; b=llkD1LJW11zb6NXBVjsb0iWMv3NM2+YEw8zPlvRh1KlXLX0t0/lEeI5XeizpVIX+NuZUu6OqxdDp2Y61nBK/0jpE0OBJ/mHQiWDOrPMcqt9AI+5UJvBEmBtCYgHXwVN28e9/O3hJEDgDz1Sn/cuF4AP9To8NyAoHGDHKR2XxJ7RBuIJjV8Ecle55h8V3KeYqzDt8xeqpK3iCbtNE6Qkl/Bi1x+l+hWU3kOKjUWoqkRdF1ZmbT+NViiuNh+Og9pc2phNqll1n8Sil5XZH0yeaReUKncomJzkI02bp9jpvm6sx2WZbXJqtEkBNqLdM7Z7i5tuVAyE4Boare3jVNDolTQ== 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=A/NuTHojEuelbf6XTENMKI8DJF7F/2DrSH7wnyREkO4=; b=JV9ZBmZQgjjvw7Fbkrl7aPxcjJDkUaqp9QWUy0P7b1VXk/GpjP6rgcebz/+C4Zzl0MrIE0YKCLHHFlkiQYmokIMOzVthKPAkHBcYyrxS7gmSk8d27Kh91X/3mBRAZhP6whH1VBfeo3NRfltG8FiFQVItNPDv/DCBKoK4AvErg50= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DM6PR12MB4123.namprd12.prod.outlook.com (2603:10b6:5:21f::23) by MWHPR12MB1247.namprd12.prod.outlook.com (2603:10b6:300:10::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.19; Wed, 27 Jul 2022 15:15:55 +0000 Received: from DM6PR12MB4123.namprd12.prod.outlook.com ([fe80::6d50:f6c5:cea4:1d95]) by DM6PR12MB4123.namprd12.prod.outlook.com ([fe80::6d50:f6c5:cea4:1d95%7]) with mapi id 15.20.5458.025; Wed, 27 Jul 2022 15:15:55 +0000 Message-ID: <1031eddb-4cfa-e94a-e77e-03aa3cb8b680@amd.com> Date: Wed, 27 Jul 2022 20:50:17 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] drm/amdgpu: fix i2s_pdata out of bound array access Content-Language: en-US To: Alex Deucher Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Sunil-kumar.Dommati@amd.com, David Airlie , "Pan, Xinhui" , open list , Daniel Vetter , Alex Deucher , =?UTF-8?Q?Christian_K=c3=b6nig?= , dan.carpenter@oracle.com References: <20220727144249.415228-1-Vijendar.Mukunda@amd.com> From: "Mukunda,Vijendar" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PN3PR01CA0187.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:be::10) To DM6PR12MB4123.namprd12.prod.outlook.com (2603:10b6:5:21f::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8e89f591-0d07-4f00-9574-08da6fe2e6a5 X-MS-TrafficTypeDiagnostic: MWHPR12MB1247:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: It9P2kacAdizA5JZEuRmWmyTLFnMZuNqCsmslynbIfLOa/Zbu7PDQLBXpELWTt2A1gZTiOzm1KRCQFseVtDLA50zFgrVbTmi/Ochu2OSM+lwaEvxeFAghpU/AFOwLbRe1VYfAB6+IPXydV6sW9esQYRTGueWxb0pBY7WAgsWTw7oKSr6uH+c8R4KkpiCBDZPAo6PEK22G5h+hRH4mxEkvno6dP2YU57Sk4U0Bw9wcRy+5cs0pcna51Suu+S6+mrJcYnsZ2B8CvO4t6i0Kx5dPQuFFMZvPrm8e9COY9e9kTysdMdsZ1VqiE21Cwbqna1g9qmQe//NTcxxkeo7MLcA0b/1o6PEBzz7tMn7qvcyF/uaDjtMp3sGsXN2gsxIBZPKv1V6cv2EF9YjFlrJmQso2F78wQJ3Q/utxNp09/ssWopLGnc+2bqarAvJqtJCY9zMoxsiAYBYNLqGUPcniIFFLjwefUVuKYE8BeANAeClVfnLQuzG8xTjHa5zPpOJ4bhm/KCRZX+lToCKWr9YmfgxqDMSskZ47w8O7htceJbr8vhuoaOomb4LOMiusDo+5HUiSmg4E8YpwUsgiGKsY5oRW0e0tsirl+HOkO8wxILrGtFzHT6yBFXFziC3wFfVTzf0l6405D18Dp18nuhcnxo12phsJue75T5MQ69E8qq0yVGu3ixgkNk8RoQ0OH1kfjtcKpUUuaqbZsw3PU39kU7k7euywLgz3dlW6QIBSb4qO5xSgGk+4M9pC9nVF7lFfEx/Lm9aZ2BQFey6IB/tb/3BdfEo6q5Xja+5BzkFZc/NrYWXlZ1uP95gXFEdkTlZzohCzAPd7+GU7OBLY/RqvlyRsg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB4123.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(39860400002)(366004)(136003)(346002)(396003)(376002)(66946007)(31686004)(316002)(36756003)(83380400001)(38100700002)(6916009)(186003)(54906003)(53546011)(6506007)(4326008)(2906002)(8676002)(31696002)(66476007)(6666004)(41300700001)(6486002)(8936002)(478600001)(66556008)(26005)(2616005)(6512007)(5660300002)(86362001)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZGIwWTF0Y0t0U0l6ZzdvSTIvWUJOMnVjMW0vclZ3RjBnM3hPd0xQbEVNdnZa?= =?utf-8?B?Wi9lUGdBTzZmeVM0QUVCVER2UFdlM20vK1dlM3pSQlhkS3hLOXpucG80UzJU?= =?utf-8?B?RkwzeUN5a2EvbXFXdy9uZTlXTGVIOGlzMVF3SGhvem9uaEZ4aTc2ZWNnZlNv?= =?utf-8?B?Qjh1cnFSbnRrUEQwcXRxTHZOQ0RmVE9NMEVRWjR0Nit3SFJxbmJCS2hSZ1Fx?= =?utf-8?B?aUd6Z1JIbFRvcVhDOTNGZzZ6T0hLZ04wcERGVnZlcTNrRHpGSmM4cGdrWXAx?= =?utf-8?B?OVJad2c5VlZJVHdTVjdWSngxVHphOFdBQzNjZkpXaWp2a1RrdFhPV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X-MS-Exchange-CrossTenant-Network-Message-Id: 8e89f591-0d07-4f00-9574-08da6fe2e6a5 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4123.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2022 15:15:55.2999 (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: KdPDrUreB8XIeGUguySN6m4SU6uy7nLwbXMWazCEdygq4GhLHdZuTTbESGLH0lo973yABspJ7XVC3Jx+1i+lKg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1247 X-Spam-Status: No, score=-2.1 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 On 7/27/22 8:25 PM, Alex Deucher wrote: > On Wed, Jul 27, 2022 at 10:42 AM Vijendar Mukunda > wrote: >> >> Fixed following Smatch static checker warning: >> >> drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c:393 acp_hw_init() >> error: buffer overflow 'i2s_pdata' 3 <= 3 >> drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c:396 acp_hw_init() >> error: buffer overflow 'i2s_pdata' 3 <= 3 >> >> Reported-by: Dan Carpenter >> Signed-off-by: Vijendar Mukunda >> --- >> drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 8 -------- >> 1 file changed, 8 deletions(-) >> >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c >> index bcc7ee02e0fc..6d72355ac492 100644 >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c >> @@ -390,14 +390,6 @@ static int acp_hw_init(void *handle) >> i2s_pdata[2].i2s_reg_comp1 = ACP_BT_COMP1_REG_OFFSET; >> i2s_pdata[2].i2s_reg_comp2 = ACP_BT_COMP2_REG_OFFSET; >> >> - i2s_pdata[3].quirks = DW_I2S_QUIRK_COMP_REG_OFFSET; >> - switch (adev->asic_type) { >> - case CHIP_STONEY: >> - i2s_pdata[3].quirks |= DW_I2S_QUIRK_16BIT_IDX_OVERRIDE; >> - break; >> - default: >> - break; >> - } > > Is this actually not used or should we just increase the allocation size? > > Alex it's my bad. i2s_pdata array size is 3. when we recently included code changes for JD platform , this piece of code was added mistakenly for Stoney platform switch case. -- Vijendar > >> adev->acp.acp_res[0].name = "acp2x_dma"; >> adev->acp.acp_res[0].flags = IORESOURCE_MEM; >> adev->acp.acp_res[0].start = acp_base; >> -- >> 2.25.1 >>