From nobody Thu Dec 26 10:40:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1732602365; cv=none; d=zohomail.com; s=zohoarc; b=l2EjBlW1UUxS81IwhzFTOUDR0T7ialBvk1e77iyn85QRV9PAe14DgiswqTq8SFeS+EirO8kfu6IwhHJ8gVcyO7h3h3rD/fHCqPmCuVWLCTx0Rad9go0lGMu6e+0xC2TFRFsRQc/fLfq9ME79DCcKBG70JsTR1dVRJAG56GLaZa4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732602365; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=YnQPQy9QUMSA3qSC9VfWBW7KVkhU2YHo+3Vjavlz26Y=; b=Eo6BvRtCr41M8UqIspCxM8becizKK1gq3Nt9o3je+zEV37GtFRJ67A2CtpX8v3Xb8t7ZslpPrnXXmK98bd0xq0DDSPnMUpxIdpe24E4AWVehT8025Hyqv99C8t3SB2m0enC+occfvlY5KlChDG6wn8V1ulb0Qk7oCZTdk9pJ/us= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1732602365703621.0673912669782; Mon, 25 Nov 2024 22:26:05 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.843106.1258971 (Exim 4.92) (envelope-from ) id 1tFp1A-0005t0-Ct; Tue, 26 Nov 2024 06:25:48 +0000 Received: by outflank-mailman (output) from mailman id 843106.1258971; Tue, 26 Nov 2024 06:25:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tFp1A-0005st-9B; Tue, 26 Nov 2024 06:25:48 +0000 Received: by outflank-mailman (input) for mailman id 843106; Mon, 25 Nov 2024 19:49:10 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tFf54-0003g2-RT for xen-devel@lists.xenproject.org; Mon, 25 Nov 2024 19:49:10 +0000 Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [2607:f8b0:4864:20::841]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 54d0354b-ab66-11ef-a0cd-8be0dac302b0; Mon, 25 Nov 2024 20:49:07 +0100 (CET) Received: by mail-qt1-x841.google.com with SMTP id d75a77b69052e-466929d6013so12842811cf.0 for ; Mon, 25 Nov 2024 11:49:07 -0800 (PST) Received: from localhost.localdomain (mobile-130-126-255-54.near.illinois.edu. [130.126.255.54]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4653c3dc08dsm49025411cf.3.2024.11.25.11.49.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Nov 2024 11:49:05 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 54d0354b-ab66-11ef-a0cd-8be0dac302b0 X-Custom-Connection: eyJyZW1vdGVpcCI6IjI2MDc6ZjhiMDo0ODY0OjIwOjo4NDEiLCJoZWxvIjoibWFpbC1xdDEteDg0MS5nb29nbGUuY29tIn0= X-Custom-Transaction: eyJpZCI6IjU0ZDAzNTRiLWFiNjYtMTFlZi1hMGNkLThiZTBkYWMzMDJiMCIsInRzIjoxNzMyNTY0MTQ3Ljc2NDA5MSwic2VuZGVyIjoiemljaGVueGllMDEwNkBnbWFpbC5jb20iLCJyZWNpcGllbnQiOiJ4ZW4tZGV2ZWxAbGlzdHMueGVucHJvamVjdC5vcmcifQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732564146; x=1733168946; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=YnQPQy9QUMSA3qSC9VfWBW7KVkhU2YHo+3Vjavlz26Y=; b=S/KDu0+/dlvFDGa91q7UQuoeFxwguWIw5ZOLZ3Wai9LX5aa54vWMmhOSe+Sjb0LjP9 cIuaiEh5IhvM9kkoAKqI89XPwiIr7bSX57duuWBflFGZUDurhKCsDHnZUi9Ql76FsFxg uew2u0syPuHlLV+srDThtV9eHFpneZjFRn51QF4hhiXmAY0kHWRdheZ+8vNCFBf87tsV xaf7sR+Sdo4yJCCEWUVWd5xT+a6/p5gAN0T7QHJGSxUcBc9bJCGOqb4s/8Pf7XN5CBP5 y7RsxAlBGJlh8HJWXrdsZf+4ipPV6Jp/WR7obaa/DIGNCenzskG5eoWbVon0Kafh0rcx pGDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732564146; x=1733168946; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YnQPQy9QUMSA3qSC9VfWBW7KVkhU2YHo+3Vjavlz26Y=; b=iuWLlBLCOQosS/H223nWDA2AgSjt2S0hwz219g5VblEpsq1pp5hqhNVy/tez/j3aON XGoD6NJwaqz2o6oUqm0FOYBPFKKHEO19Nyo3AcQ4kJLuMip/LrYxANp8rKU0q4fi5VZi d8ZG2J7hgmeYfSiDPPPNG3KK05MqnzvbW4uN4b9R2/HBmYYaFV7z69Zfrjg8kcZxKA2u WpVT/ug5v2I/mUGinDxhP9vZ/iOfuVlEbxwkpjGYYZiMXtkdwcRfbZnzFqRRxp4hQ9nP agIi9t8grbxmyk2ZK20sIESf8+ci5k7gsL9IsFeMWtOwt2oE830ESSTaxBPet9/4WP8m CTug== X-Forwarded-Encrypted: i=1; AJvYcCV7aSwxfq/MNWYjXet6m5qAIEHFWXiZ0swttFhtI5lOn2V6zBNhO5qYJJ817sxvPWKIO4bQqIG2Kck=@lists.xenproject.org X-Gm-Message-State: AOJu0YzrUBLMBHRSZe3XDETKIPm0iOrbBu3Tf00u1kGIJvcEWxdqFF7t xdX4YP5zECNeleiO7wHVYJ0gwkWXFq+MjePidzCU2itOBFba4ARY X-Gm-Gg: ASbGncs3ocxVCf6Ub/Sz7zoH6pdyIhe5CRZS/UYPjC1d/gvB44VSNsxcM0lVhDjWK7F fDp6doywFveVGcklB6vEdyjPuOjrkGRb/5XpN3UQeWNAOdbBN4JNElpoiLcSpgkZD3d88c2icon g54dFpSIfgNNatZvcU/nGcTQhTNArt/rZbyZcdbm2ixF1OMG1uocGmVwFBWtlIJp3YwjH+z+TCl e93U/LPE/nB9B+HkFT71x3gudg5J+TBWYj1B+s0oHR+ag57RxiKLHnh7iq5Bu3a3CXfLjRYDGws Qwuo4cwCJCtc4O/YciSvhgpudYoDhSq6E+ua X-Google-Smtp-Source: AGHT+IGASnVlZTy8uOIIeLvm0VVgeI8MN7apGYPIXsgonX7l5aN8h7HkmTpP2xqHs+QhD2knS7irSw== X-Received: by 2002:a05:622a:391:b0:461:17e6:2651 with SMTP id d75a77b69052e-4653d525977mr210750511cf.8.1732564146425; Mon, 25 Nov 2024 11:49:06 -0800 (PST) From: Gax-c To: oleksandr_andrushchenko@epam.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com Cc: dri-devel@lists.freedesktop.org, xen-devel@lists.xenproject.org, Zichen Xie Subject: [PATCH] drm/xen-front: cast calculation to __u64 in xen_drm_drv_dumb_create() Date: Mon, 25 Nov 2024 13:48:51 -0600 Message-Id: <20241125194850.14274-1-zichenxie0106@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1732602368397019100 Content-Type: text/plain; charset="utf-8" From: Zichen Xie Like commit b0b0d811eac6 ("drm/mediatek: Fix coverity issue with unintentional integer overflow"), directly multiply args->pitch and args->height may lead to integer overflow. Add a cast to avoid it. Signed-off-by: Zichen Xie --- drivers/gpu/drm/xen/xen_drm_front.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/xen/xen_drm_front.c b/drivers/gpu/drm/xen/xen_= drm_front.c index aab79c5e34c2..639aad26f6c9 100644 --- a/drivers/gpu/drm/xen/xen_drm_front.c +++ b/drivers/gpu/drm/xen/xen_drm_front.c @@ -415,7 +415,7 @@ static int xen_drm_drv_dumb_create(struct drm_file *fil= p, * For details also see drm_gem_handle_create */ args->pitch =3D DIV_ROUND_UP(args->width * args->bpp, 8); - args->size =3D args->pitch * args->height; + args->size =3D (__u64)args->pitch * args->height; =20 obj =3D xen_drm_front_gem_create(dev, args->size); if (IS_ERR(obj)) { --=20 2.34.1