From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22CD5CDB47E for ; Wed, 11 Oct 2023 20:21:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233446AbjJKUVs (ORCPT ); Wed, 11 Oct 2023 16:21:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231163AbjJKUVr (ORCPT ); Wed, 11 Oct 2023 16:21:47 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 156DD90 for ; Wed, 11 Oct 2023 13:21:46 -0700 (PDT) Received: from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi [213.243.189.158]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 15AC3669; Wed, 11 Oct 2023 22:21:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1697055700; bh=rPIOQ1E80lsFv6SQ9fJCB09mkQvP5XdXo/WM8mMmpzc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SmNZwQiL7clyYOW5JzGG+qfVYarE8vlEI3vr8UWjNmdJ17RpDlv1I1n2Nf/v8jstx STfUSuBrlqaLeSISbjTyOvFacgjvvDODpyapoaBbbB8gvssbOi4bV64jlL+Kdai/+h ch+vMGQRRE2+r6YNRXl0BEukRc+JSOGedVqPMr14= Date: Wed, 11 Oct 2023 23:21:50 +0300 From: Laurent Pinchart To: Sakari Ailus Cc: Alexander Shiyan , linux-media@vger.kernel.org, Rui Miguel Silva , Martin Kepplinger Subject: Re: [PATCH] media: imx: imx-mipi-csis: Fix null pointer dereference when link is not set Message-ID: <20231011202150.GD5306@pendragon.ideasonboard.com> References: <20231006074654.11468-1-eagle.alexander923@gmail.com> <20231011194833.GC5322@pendragon.ideasonboard.com> <20231011200615.GC5306@pendragon.ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On Wed, Oct 11, 2023 at 08:19:03PM +0000, Sakari Ailus wrote: > On Wed, Oct 11, 2023 at 11:06:15PM +0300, Laurent Pinchart wrote: > > On Wed, Oct 11, 2023 at 08:01:50PM +0000, Sakari Ailus wrote: > > > On Wed, Oct 11, 2023 at 10:48:33PM +0300, Laurent Pinchart wrote: > > > > On Wed, Oct 11, 2023 at 07:44:59PM +0000, Sakari Ailus wrote: > > > > > On Fri, Oct 06, 2023 at 10:46:54AM +0300, Alexander Shiyan wrote: > > > > > > Let's add a check for src_sd before using it. > > > > > > The link may not be set, in which case the call to this function will fail. > > > > > > > > > > That would seem like an understatement. > > > > > > > > > > Any idea when this was introduced (and which patch did), Fixes: and Cc: > > > > > stable should be added if this is already in a release. > > > > > > > > It's actually an issue in the pipeline validation code in the V4L2 core. > > > > The link is marked as MUST_CONNECT, but that isn't handled properly :-( > > > > It's been on my todo list for a while but I haven't had time to get to > > > > it. Feel free to give it a go. > > > > > > What's wrong there? It used to work at least... > > > > It's called a regression :-) If I recall correctly, if the pad is not > > connected, it's not added to the list of pads to check, and the > > MUST_CONNECT flag is not checked. > > This has potential for other similar issues in a number of drivers. Indeed, which is why it should be fixed there. > I suppose this broke with the graph traversal changes ~ a year ago? I assume so, yes. -- Regards, Laurent Pinchart