Received: by 2002:a05:6358:16cd:b0:dc:6189:e246 with SMTP id r13csp780024rwl; Fri, 4 Nov 2022 06:22:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4VGyf+TK2nNccCR9Phm67T6XK8k6v5FtJi3aEmViCNR804ZCArF3/KCpDWb5ag/eu/1G2w X-Received: by 2002:a63:d512:0:b0:46a:ff05:ce8c with SMTP id c18-20020a63d512000000b0046aff05ce8cmr31222793pgg.292.1667568164886; Fri, 04 Nov 2022 06:22:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667568164; cv=none; d=google.com; s=arc-20160816; b=Sw/3sbugZERI8GPYxDdqsWzQCfeQcKQI1rzUmbhM3SfXKPKxuw4r+r2jGfow/vUP6C 1BKgRSL+7iMN08LRIliqlfa7GLTrCVK5bbQtsNNidZgyfFP3kryJZs6COkVrjCRmIpOH Ri3k23I1xl/1vBh6ocADpSzaQajd3LfbeC3cibJyGL6+QMORIM7RrZgdIUC23+xjC55D 6bnLd4yov7rBtSdmMmmb5Q1LB0liTwCImRTE5XUB9+Sgu6aHVbwrJNvF0NCn5JeAlC/b ceD3AV1Iz02YZtmtgCOneMWepBIjADqlqLJTyMyZH/T0olkBam83UqvzmN02FqiXk0bH S/Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Doh95W3fsNSnVZlspRWhFkk6YmzKsLQTbY34WR9BimU=; b=IqZk+/RZOamTZbS+TWKFgvp+Wzjd0vbyBin1bjnr9dJiUd7cy/Z9+UfHNFPybS1Lm2 ENSXUqlp3sneJUEcKFJWW041B+cU9XKNG01o9bh0ho9h4XWadRwpfvTnqvXVfnWjNxFo 7a0MATgvdsDSMursKCZJr54TwDe4ZG9BEAsYvPGGkS26XZHJ5+F1UP7SFbwV6pj3nnKT l/LD52bUHAoeI6RyWZrlSqLjq/evdEbnlyY+PZ0IDkOLjgn39+LHfXu+V+XqBJZdh1pu +vTfwvuX1P1eHFyraIPK2erEy/yirMHfBXn8s9lro8ULm4cXF5Pd5cFW4bRynw1KpFJ9 Pk1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QOJEyjvT; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u4-20020a170902e5c400b001748ede4e05si5063008plf.119.2022.11.04.06.22.32; Fri, 04 Nov 2022 06:22:44 -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=@kernel.org header.s=k20201202 header.b=QOJEyjvT; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231912AbiKDMld (ORCPT + 96 others); Fri, 4 Nov 2022 08:41:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231297AbiKDMl3 (ORCPT ); Fri, 4 Nov 2022 08:41:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1ADA66579; Fri, 4 Nov 2022 05:41:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 997A46216F; Fri, 4 Nov 2022 12:41:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6FDF1C433D6; Fri, 4 Nov 2022 12:41:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667565687; bh=LnaHhDoo9rCQOdDxxzfKdDbPoZ5D/fnx1KFW8YcmFV8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QOJEyjvTPGRCxwpjqjwB47wOvleU8AqzQ1U2FeWSOuVDxTPLTWbRao52Q5bUEwBY7 mO4QU/vPnSMvvA6EWoPCa0rEcr1ohE1GMFvcHnqa60ewIlYrn5dwEFndJdTy4d+Pfq ycbIhFEJESB/6n8p+mC8rB2QdX36/krY7pee5CR34O8j22Aja0XD6uBzhe0usZCIhT pvq8LBJ6rrvb7Mu+RiimEgZB5LAy3JD1cJ4oZiVor/j33wQVu8IGo12iRSwhRxjCaa eoGKCxwrr7Tsxi6Vaque0+I9FxcSGpJOvmIZ/14TnZPk3HlG8xkiXn5sckoJ3VaJPK f6FyIT4mBG9oA== Date: Fri, 4 Nov 2022 18:11:22 +0530 From: Vinod Koul To: Anastasia Belova Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: Re: [PATCH] vdec_vp9_if: add check for NULL for vsi->frm_bufs[vsi->new_fb_idx].buf.fb in vp9_swap_frm_bufs Message-ID: References: <20221028092516.19070-1-abelova@astralinux.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221028092516.19070-1-abelova@astralinux.ru> X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 28-10-22, 12:25, Anastasia Belova wrote: > If vsi->frm_bufs[vsi->new_fb_idx].buf.fb == NULL while cleaning > fb_free_list NULL-pointer is dereferenced. Clearly you have incorrect maintainer and list, pls fix and send to relevant ppl > > 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/drivers/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 *inst) > * clean fb_free_list > */ > if (vsi->frm_bufs[vsi->new_fb_idx].ref_cnt == 0) { > - if (!vp9_is_sf_ref_fb( > + if (vsi->frm_bufs[vsi->new_fb_idx].buf.fb != NULL && !vp9_is_sf_ref_fb( > inst, vsi->frm_bufs[vsi->new_fb_idx].buf.fb)) { > struct vdec_fb *fb; > > -- > 2.30.2 -- ~Vinod