Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2216949rwi; Fri, 28 Oct 2022 04:37:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4r9gdQYNQ8fdE4KJjA+6JjqKwVxTiGHZLPVyebF71Wd2+3ihez7jmIh3ZBoJb7Sbk+BSYI X-Received: by 2002:a17:906:db07:b0:77b:82cf:54af with SMTP id xj7-20020a170906db0700b0077b82cf54afmr48159470ejb.666.1666957038017; Fri, 28 Oct 2022 04:37:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666957038; cv=none; d=google.com; s=arc-20160816; b=y2rJQRStRaWvwIxmMXy848MqTS2DVvFlHZ/fQZ+Pj+4oyZi/jdsRCwG8udVQ/qvmtz SJs7H3pHFRpCktFPArvs6VkJUTs/gNNhaU4FtbEraootR6XPOs1iDYLq9sZ34pb0sZJ0 8lFcJt64zxOeNEDqWZUSJYTwoQzfXX3bgT5pBbFlqY+opI5nKDEyFbYIKdP2sFQ7pM5/ c85/MdCRdoEW5Wy/JcsR46MdQfp8IApDgo37YrBsCDzW2JhAlQkSJMKrePsDcKlEZtYP WJUl0R+jct3RGOLAC8LnGkAh2qjiDOjJ+NRdWWdC/S3RDhww+WSHBPmGSENuAkhjI2/U ieLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=zwzLdWoWFgq62O5OUUPFj6Ag8jaRzLM+v7K+j93cq9Q=; b=Y7heRSbJARU+Oinrk69euCdKPPuUJDk/Vyc4VqTwXYd137q0ngwz5Akqp3eFLAfSIi AjSXL6gVN6WxX1vvhGAOJlC8papPV+wLb2f1LGJ9zonTCirGq7xI4SYy9O3SwjIQ4vIu FdjzUiNdcmjYfxTr8MqO6WbYj1FIcjjq8PiPaUdQhVgmRKbB4XUTuBFATMPi1nQH1bpg HBwBzwGnCLd93g6b6cs9P7jym57wZ+U+t1LDFKctCi7f+VQdXSWSAjMGeYQy8KvF00vH ltxz81N8w3A2ajTg6O1r4LNwxbqpiQZigT95CGH7kBPymvqo9Hfb4znDH2dW5x3iYn1i RIVw== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x16-20020a170906135000b007a7d22b9e0bsi3530135ejb.133.2022.10.28.04.36.52; Fri, 28 Oct 2022 04:37:17 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230035AbiJ1KPh (ORCPT + 99 others); Fri, 28 Oct 2022 06:15:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229975AbiJ1KPc (ORCPT ); Fri, 28 Oct 2022 06:15:32 -0400 X-Greylist: delayed 577 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 28 Oct 2022 03:15:28 PDT Received: from mail.astralinux.ru (mail.astralinux.ru [217.74.38.119]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B5B45419E; Fri, 28 Oct 2022 03:15:26 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id D5A801864518; Fri, 28 Oct 2022 13:05:55 +0300 (MSK) Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id RQ0YjnkqfdBW; Fri, 28 Oct 2022 13:05:55 +0300 (MSK) Received: from localhost (localhost [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id 7E2381864579; Fri, 28 Oct 2022 13:05:55 +0300 (MSK) X-Virus-Scanned: amavisd-new at astralinux.ru Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id PqBdEedcLvs2; Fri, 28 Oct 2022 13:05:55 +0300 (MSK) Received: from rbta-msk-lt-106062.astralinux.ru (unknown [10.177.20.20]) by mail.astralinux.ru (Postfix) with ESMTPSA id DF1611864315; Fri, 28 Oct 2022 13:05:54 +0300 (MSK) From: Anastasia Belova To: Greg Kroah-Hartman Cc: Anastasia Belova , Tiffany Lin , Andrew-CT Chen , Mauro Carvalho Chehab , Matthias Brugger , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: [PATCH 5.10 1/1] vdec_vp9_if: add check for NULL for vsi->frm_bufs[vsi->new_fb_idx].buf.fb in vp9_swap_frm_bufs Date: Fri, 28 Oct 2022 13:05:39 +0300 Message-Id: <20221028100539.30925-2-abelova@astralinux.ru> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221028100539.30925-1-abelova@astralinux.ru> References: <20221028100539.30925-1-abelova@astralinux.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 If vsi->frm_bufs[vsi->new_fb_idx].buf.fb =3D=3D NULL while cleaning fb_free_list NULL-pointer is dereferenced. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Anastasia Belova --- drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c b/drive= rs/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c index d9880210b2ab..dea056689b48 100644 --- a/drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c +++ b/drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c @@ -512,7 +512,7 @@ static void vp9_swap_frm_bufs(struct vdec_vp9_inst *i= nst) * clean fb_free_list */ if (vsi->frm_bufs[vsi->new_fb_idx].ref_cnt =3D=3D 0) { - if (!vp9_is_sf_ref_fb( + if (vsi->frm_bufs[vsi->new_fb_idx].buf.fb !=3D NULL && !vp9_is_sf_ref_= fb( inst, vsi->frm_bufs[vsi->new_fb_idx].buf.fb)) { struct vdec_fb *fb; =20 --=20 2.30.2