Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp375108imn; Wed, 27 Jul 2022 08:35:59 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s+y1VeuOFRwaPjRcLH46a0XjxSVhyeL56ufQs+iotFTo1dbVNvHz9Ko6lgMaBMUnZkBaFc X-Received: by 2002:a17:902:c40c:b0:16d:b4c9:c360 with SMTP id k12-20020a170902c40c00b0016db4c9c360mr2706926plk.26.1658936159618; Wed, 27 Jul 2022 08:35:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658936159; cv=none; d=google.com; s=arc-20160816; b=0GtAFGxrEq1OPSLjngb7DBD7cnUaN+D27TdJ3NGCAHo6a5NJtg45GfYGb2bU4vr8J8 vVF9aBhytAeLluYGfXUMWoNpVnFpLXDvEjI1dfGH6DahJI7Ve95GJhPwKOQg7p75rPgy 9L0SwhxgCj3NKPJJdfkw/i6W1+xCu6inqNrs93Cu9C7f3ej8COfEMJ2K/4KoiORRMvtD mYrQaA0tNuglt4pGjEMLaKSCSxPbEfvlG9+ewmGHRKdWG3/ovV91DkObFbHiiozNU8tz fvU7FnXSbp3YWqjPNiLIpOe1gz1x51OtGYyrq/1rTt0VoHGdxdchf0b86ZNSt9//h2Hb bMBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=3QoQIcw2k7KJYASXT3ZADS6J+gQkSi9pbz+G9ycdbwU=; b=FRaDUNrCBrSFUqVXriwMHLwxLNlfc9GFZtV9qf1GWlllcRbaKAgPcaQA7xsgFeApp7 He6mxEtlvuAmOXOqlavIWz0+jfNerR+93So6gSP3ddeiC6FMn4uUAuD/zpIg9h0A3Mev 7NbvF1rePvwkFVj4458GUUtNPmbGttJrBjdNIv86Ps0iZJSTQeyP4RG6Fotrjjp4RW+T kWnoIHVDIitRe+mnKHEc4ss3/T/9ttWAzJv/xQ6Kb7h/qRNlvDiSKNXBwg6Bvv2zc4kT 5GoodE/eX38qipkb6zh92DHx4ujExCrf91LXQXJ2qRwBnB5cujXLyVZI9/Sx3xbBgWFM nMjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HCbs8iPs; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e20-20020a056a001a9400b005298f42c3aasi22511108pfv.271.2022.07.27.08.35.27; Wed, 27 Jul 2022 08:35: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=@gmail.com header.s=20210112 header.b=HCbs8iPs; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233872AbiG0PXP (ORCPT + 99 others); Wed, 27 Jul 2022 11:23:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233239AbiG0PXN (ORCPT ); Wed, 27 Jul 2022 11:23:13 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2DBD3205F for ; Wed, 27 Jul 2022 08:23:12 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id sz17so32093122ejc.9 for ; Wed, 27 Jul 2022 08:23:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3QoQIcw2k7KJYASXT3ZADS6J+gQkSi9pbz+G9ycdbwU=; b=HCbs8iPs9gJhX59IpgPJsCa2fuxs/UEAYiUEkx6VbdfgffAl0JiY0Kl0ovVFN7tKuH TBARPeHOi9Fkh83OJhx+l0/TUqfogT7lZ11O4JqeHqfZ5IoFAcw/yLWuF6Ke235el7oO Zr8ZOPAxr2g6sjyooHYIN8X8ZwZpJtRbfsTwOjiPJVt89aT5Hq2Ig8kVGTuhn3pijiwJ nMs9N0HehNF8gC+hhbxqFCl4uw+yje7AK2GbrG8SNULDXr/MrsOmw+l7xg3dABd1Fh7k yazGhqOdZz57nHnLxuiVfsnRmJaWH/D+70indNftdRsODejYRRxqf2MpT95NI+y66PkG 8+uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3QoQIcw2k7KJYASXT3ZADS6J+gQkSi9pbz+G9ycdbwU=; b=WvYyJkZFbXV2ZT4YCZlBlkNKjI2Jk0G4omcM99d/RaLDpNz6ghrzMTEOQD8YQQmAzO IbcypfyPAa9jVBsBuoq6nKg+/wTogA0BZDQCjxwXlNKIpUpRxYy3V7aSWUvdohZd2oII KSlhSklq3XtFc+L4oic/0LpOOhIhDmx+gXD6RMpqdSA3Rms9hqgyVcsC67mncnJem7v0 WM/Itou+TXEUtpvw0LDQSrzGpL7RjkxZC6RA79I2+0QlswajWH4IxuZpSBHvFhmVXOUI O0pdk7awnX35ccM5/gWF8H3m6KhKWSbd9TlfTJhlqgsZDmjCO+9Qx+A6rm3/YSey8xku c0fw== X-Gm-Message-State: AJIora/WIYqjJjuawCRJypfKs6UK0XChEEZZcwl9tTsNAo7FQMj+l8Am 7NIycJw03yI6LYJ429P0gPnP57nb0OlRuoBUDjg= X-Received: by 2002:a17:907:2723:b0:72b:5af3:5a11 with SMTP id d3-20020a170907272300b0072b5af35a11mr17884124ejl.584.1658935391241; Wed, 27 Jul 2022 08:23:11 -0700 (PDT) MIME-Version: 1.0 References: <20220727144249.415228-1-Vijendar.Mukunda@amd.com> <1031eddb-4cfa-e94a-e77e-03aa3cb8b680@amd.com> In-Reply-To: <1031eddb-4cfa-e94a-e77e-03aa3cb8b680@amd.com> From: Alex Deucher Date: Wed, 27 Jul 2022 11:22:59 -0400 Message-ID: Subject: Re: [PATCH] drm/amdgpu: fix i2s_pdata out of bound array access To: "Mukunda,Vijendar" 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 Wed, Jul 27, 2022 at 11:16 AM Mukunda,Vijendar wrote: > > 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. Thanks. Patch is: Acked-by: Alex Deucher > > -- > 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 > >> >