Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp276171rwr; Thu, 27 Apr 2023 00:47:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6uL1qFPHD6Ick7p987L94oZqpfJiNfV00t9MAT8I+9GVBd6DAlQaE4YK0M5eDZYabXrOLQ X-Received: by 2002:a05:6a21:32a2:b0:f5:7e36:485b with SMTP id yt34-20020a056a2132a200b000f57e36485bmr618770pzb.6.1682581677483; Thu, 27 Apr 2023 00:47:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682581677; cv=none; d=google.com; s=arc-20160816; b=Hp/MyL1nZWZCFUOgvv6CUq4S99/CVjKEDZRXNuLFRqKq5CN6zdyLSCOIdp5CvJnH49 UDP474+6mCFHgyv2xwfIFsbPfYXmKCiZnREyj7CKNtggn//VHsLzmBnWqao2qjfqgtn1 NCetcHwV3WXAXEW5bxyicyVFCR+Fyuvt0naUG71dQl6Upl9JGLBu9o7/W8q+VaFHLpRp zNZAcU0P5Gz9tXZXWWSiF7/Mn8lBW2rOXrCaUNCF4oPF87KYBJMkuhbBXFMAYPZ8+78n LSA/7w58ij5YgF8lfOgl5qT8cq5Xt9QcQxks8nd20OwunXnanTobncsux/eH2pP1reCa Xfbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=yN4Wi6us9tqsW8wES8TfgapwiSQM5W3hLxG1tm9HFuk=; b=BYKQeZOPK4E4AweS0gsWG0lsU8rSkDkTpMUHTE3HxspKqcP+Q+lDqJr/8P0ZIP5dx0 4Ni2k0m8xdVJY96vApqMhOSNNMuFMrOZEFznQwYSKyenJ7qXvExo/1x2SQCtvVNgyj1w UAWluH0uuTadzOuNoDzFn1iAaZvhfw97oc5IxxyNStxUA5QCSzDkuRLs7CPB+lsDjnI3 /F0S7AmbTWYqmGfh+xn2rrlcnXlNcIauuhCUs8cPMntk+iHJ3yMAyxcE6ZXbPQqSfgo2 p51To/RDcl1d8jHThEmm2VLk2bEQPMfaWKjxhjUWpDD5Nh4EoO3MDZLqryaZK3dxdQJE tCRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="Z/MeeZiH"; 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 z13-20020a63d00d000000b0051f0e959dc6si17951634pgf.483.2023.04.27.00.47.45; Thu, 27 Apr 2023 00:47:57 -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=20221208 header.b="Z/MeeZiH"; 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 S243129AbjD0HpZ (ORCPT + 99 others); Thu, 27 Apr 2023 03:45:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243115AbjD0Hoy (ORCPT ); Thu, 27 Apr 2023 03:44:54 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35650173E; Thu, 27 Apr 2023 00:44:53 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5050497df77so12525577a12.1; Thu, 27 Apr 2023 00:44:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682581491; x=1685173491; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=yN4Wi6us9tqsW8wES8TfgapwiSQM5W3hLxG1tm9HFuk=; b=Z/MeeZiHBqR8BxiSLLgHCC/EH/QJKBpmBB+s+TiEbkHjNHGfQk8bgl3fEdk6cTAb8s i5Rgr7ATOP4iz9wyQn6Aecx1h53Y7H/iWCEF3Xs1jE6x40FOT7R87qeSkCvdCDsnX3oM o7J6sMW/R47q/Q95xro8n92wplp3kDXiWD2xJr75vZTJrwQUwzjwYHPZkolBOMlHwZC6 LeTwzxCIf4xH76inLIaInXPJhcTfXWNcXkwUyGxuN7+aEVNRnjZhgEnXr73M0Vyo7AoP XYXo7mO5TFHAHW606Dt5BMF5OXx3j7KHPy0Q5SU2Njjve624+FyCJcm5dvnNRJ2HorOy 4yNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682581491; x=1685173491; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yN4Wi6us9tqsW8wES8TfgapwiSQM5W3hLxG1tm9HFuk=; b=Xs0o8jtl5gc0o6pMBEJ9q1DaDsXlqHVsm2r+HsQulerMOJiI6KD+SDrb4MASIfynDr N4Dm3vDZjNB35e3zyxTQ9TRmKsZeYisaZj+iw2/g11G24Y2NC/08NWmJ7HxeHC/RNiEI Cp9Py60EjYiAHV9yZ+RjQ1bQrCuQvWIYS4uF1UCXF8VFVaCkmHzKgyNWIduRFMHRe9tC v2nmXUKvzU+QafCrZTNSYUQHNwG6UQerqM3dQrartyT2JuDqxBnxF7nU4kxK8hBQfiyL x6oxp1l8j84sVzrmsPeuTgQn0rTKWan+EXaCcvPt3sxyE5RHjo+ooFFT/NxJ6NIjNEk0 Tb1Q== X-Gm-Message-State: AC+VfDzQ8B8vn+VUITdNB+OxJYbrLWkCCYjv2O+P/0AETUXCjqHdFso2 4NP/BvrSspqzjZDR+eO1RIqoNlJKWxYW+EiS/S+gsoJIE4u0Fg== X-Received: by 2002:a17:907:961b:b0:94e:6a24:9463 with SMTP id gb27-20020a170907961b00b0094e6a249463mr909190ejc.28.1682581491617; Thu, 27 Apr 2023 00:44:51 -0700 (PDT) MIME-Version: 1.0 References: <20230419122233.3440-1-hackyzh002@gmail.com> In-Reply-To: <20230419122233.3440-1-hackyzh002@gmail.com> From: whitehat002 whitehat002 Date: Thu, 27 Apr 2023 15:44:39 +0800 Message-ID: Subject: Re: [PATCH v3 2/2] drm/amdgpu: Fix integer overflow in amdgpu_cs_pass1 To: alexander.deucher@amd.com Cc: christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, sumit.semwal@linaro.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,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 hello What is the current status of this patch, has it been applied? hackyzh002 =E4=BA=8E2023=E5=B9=B44=E6=9C=8819=E6=97= =A5=E5=91=A8=E4=B8=89 20:23=E5=86=99=E9=81=93=EF=BC=9A > > The type of size is unsigned int, if size is 0x40000000, there will > be an integer overflow, size will be zero after size *=3D sizeof(uint32_t= ), > will cause uninitialized memory to be referenced later. > > Signed-off-by: hackyzh002 > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd= /amdgpu/amdgpu_cs.c > index 08eced097..89bcacc65 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c > @@ -192,7 +192,7 @@ static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p= , > uint64_t *chunk_array_user; > uint64_t *chunk_array; > uint32_t uf_offset =3D 0; > - unsigned int size; > + size_t size; > int ret; > int i; > > -- > 2.34.1 >