mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Colin Ian King <colin.king@canonical.com>
To: Steve Longerbeam <slongerbeam@gmail.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Rui Miguel Silva <rmfrfs@gmail.com>,
	linux-media@vger.kernel.org, devel@driverdev.osuosl.org,
	linux-arm-kernel@lists.infradead.org
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: re: media: staging/imx: Improve pipeline searching (bug report)
Date: Wed, 26 Jun 2019 19:27:51 +0100	[thread overview]
Message-ID: <9b6d7f0e-f191-e5d5-e20b-9244800678fe@canonical.com> (raw)

Hi,

Static analysis with Coverity on Linux next has found a potential issue
with the following commit:

commit 3ef46bc97ca2c918b7657a08220c7340a9bb07a2
Author: Steve Longerbeam <slongerbeam@gmail.com>
Date:   Fri May 10 17:50:11 2019 -0400

    media: staging/imx: Improve pipeline searching


The issue is in drivers/staging/media/imx/imx-media-utils.c in function
find_pipeline_entity:

        struct media_pad *pad = NULL;

pad is assigned a NULL

        struct video_device *vfd;
        struct v4l2_subdev *sd;

        if (grp_id && is_media_entity_v4l2_subdev(start)) {
                sd = media_entity_to_v4l2_subdev(start);
                if (sd->grp_id & grp_id)
                        return &sd->entity;
        } else if (buftype && is_media_entity_v4l2_video_device(start)) {
                vfd = media_entity_to_video_device(pad->entity);

..and above the null pad is being dereferenced causing a kernel oops.

                if (buftype == vfd->queue->type)
                        return &vfd->entity;
        }


Colin

             reply	other threads:[~2019-06-26 18:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-26 18:27 Colin Ian King [this message]
2019-06-26 18:35 ` Steve Longerbeam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9b6d7f0e-f191-e5d5-e20b-9244800678fe@canonical.com \
    --to=colin.king@canonical.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=rmfrfs@gmail.com \
    --cc=shawnguo@kernel.org \
    --cc=slongerbeam@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®