mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robert Bozik <robertbozik@gmail.com>
To: linux-media@vger.kernel.org
Cc: sakari.ailus@linux.intel.com, mchehab@kernel.org,
	robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	media-ci@linuxtv.org, sashiko-reviews@lists.linux.dev
Subject: Re: [PATCH v2 2/3] media: i2c: Add driver for OmniVision OV32C4
Date: Fri, 28 Aug 2026 15:59:41 +0200	[thread overview]
Message-ID: <20260828135941.23605-1-robertbozik@gmail.com> (raw)
In-Reply-To: <20260828133537.C61EC1F00A3A@smtp.kernel.org>

On Fri, Aug 28, 2026, sashiko-bot@kernel.org wrote:
> [Severity: High]
> Potential NULL pointer dereference in ov32c4_set_format() when
> sd_state is NULL.

I checked this and I do not believe it is a defect here, so I have not
changed the code. Please tell me if you disagree.

The mechanism is described accurately as far as it goes: check_state()
only rejects a NULL state for V4L2_SUBDEV_FORMAT_TRY, so an ACTIVE call
passes the guard, and __v4l2_subdev_state_get_format() does return NULL
for a NULL state.

But that function opens with

	if (WARN_ON_ONCE(!state))
		return NULL;

so a NULL state there is treated as a bug to be reported, not as an
input to be handled. And 37 drivers under drivers/media/i2c/ assign
through it exactly the way this one does, none of them checking the
result; the line here is identical to ov02c10.c:712, which is the
driver this one was modelled on.

So if that path is reachable, it is a core problem affecting all of
them and the fix belongs in the core rather than in a new sensor
driver - adding a check only here would make this the one driver in
the subsystem that does it. I am happy to add it if you would prefer.

Thanks,
Robert

  parent reply	other threads:[~2026-08-28 13:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-28 13:21 [PATCH v2 0/3] media: Add OmniVision OV32C4 sensor driver Robert Bozik
2026-08-28 13:21 ` [PATCH v2 1/3] dt-bindings: media: i2c: Add OmniVision OV32C4 Robert Bozik
2026-08-28 16:23   ` Conor Dooley
2026-08-28 13:21 ` [PATCH v2 2/3] media: i2c: Add driver for " Robert Bozik
     [not found]   ` <20260828133537.C61EC1F00A3A@smtp.kernel.org>
2026-08-28 13:59     ` Robert Bozik [this message]
2026-08-28 13:21 ` [PATCH v2 3/3] media: ipu-bridge: Add " Robert Bozik
2026-08-28 15:23   ` Sakari Ailus
2026-08-28 15:34     ` Robert Bozik

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=20260828135941.23605-1-robertbozik@gmail.com \
    --to=robertbozik@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=media-ci@linuxtv.org \
    --cc=robh@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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®