All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Sergey Lebedev" <lsa.uz@pm.me>
Cc: media-ci@linuxtv.org, robh@kernel.org,
	devicetree@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v3 3/3] media: ipu-bridge: Add Sony IMX681
Date: Wed, 09 Sep 2026 20:46:24 +0000	[thread overview]
Message-ID: <20260909204624.9A5E91F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260909203717.90605-4-lsa.uz@pm.me>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Dangling secondary fwnode pointers upon unregistration leading to UAF
--

commit 14048fa470e12c0fb57d0c87c84bc92c1497b100
Author: Sergey Lebedev <lsa.uz@pm.me>

media: ipu-bridge: Add Sony IMX681

This patch adds support for the Sony IMX681 user-facing sensor to the IPU
bridge. It ensures the sensor can be properly connected in the graph by
mapping its ACPI identifier.

> diff --git a/drivers/media/pci/intel/ipu-bridge.c b/drivers/media/pci/intel/ipu-bridge.c
> index 7e65491faf6dc..68c2eb326f1dc 100644
> --- a/drivers/media/pci/intel/ipu-bridge.c
> +++ b/drivers/media/pci/intel/ipu-bridge.c
> @@ -97,6 +97,8 @@ static const struct ipu_sensor_config ipu_supported_sensors[] = {
>  	IPU_SENSOR_CONFIG("OVTI5675", 1, 450000000),
>  	/* Omnivision OV8856 */
>  	IPU_SENSOR_CONFIG("OVTI8856", 3, 180000000, 360000000, 720000000),
> +	/* Sony IMX681 */
> +	IPU_SENSOR_CONFIG("SONY0681", 1, 969600000),

[Severity: High]
This isn't a bug introduced by this patch, but there is a pre-existing issue
in the IPU bridge setup and teardown path.

In ipu_bridge_connect_sensor(), the ACPI device's secondary fwnode pointer is
manually assigned to point to the newly created software node:

    primary->secondary = fwnode;

Additionally, ipu_bridge_instantiate_ivsc() also sets the secondary fwnode
for the CSI device:

    set_secondary_fwnode(sensor->csi_dev, fwnode);

When an error occurs and err_free_swnodes is reached during module
initialization, or when ipu_bridge_unregister_sensors() is called during
teardown, the underlying software nodes are freed:

    software_node_unregister_node_group(sensor->group);

However, primary->secondary and the csi_dev secondary fwnode are never cleared
back to NULL. Does this leave dangling pointers that could lead to a
use-after-free if another subsystem iterates over or accesses the secondary
fwnodes after the group is unregistered?

>  	/* Sony IMX471 */
>  	IPU_SENSOR_CONFIG("SONY471A", 1, 200000000),

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260909203717.90605-1-lsa.uz@pm.me?part=3

  reply	other threads:[~2026-09-09 20:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-09 20:37 [PATCH v3 0/3] media: Add support for the Sony IMX681 Sergey Lebedev
2026-09-09 20:37 ` [PATCH v3 1/3] dt-bindings: media: Add " Sergey Lebedev
2026-09-11  7:36   ` Krzysztof Kozlowski
2026-09-09 20:37 ` [PATCH v3 2/3] media: i2c: Add Sony IMX681 sensor driver Sergey Lebedev
2026-09-09 20:52   ` sashiko-bot
2026-09-09 21:14   ` Sergey Lebedev
2026-09-11  7:38   ` Krzysztof Kozlowski
2026-09-11  9:24     ` Sergey Lebedev
2026-09-09 20:37 ` [PATCH v3 3/3] media: ipu-bridge: Add Sony IMX681 Sergey Lebedev
2026-09-09 20:46   ` sashiko-bot [this message]
2026-09-10 10:36 ` Test for [PATCH v3 0/3] media: Add support for the " German
2026-09-10 11:22   ` Sergey Lebedev
2026-09-10 11:48     ` Test on another machine and userspace for [PATCH v3 0/3] media: Add support for the Sony IMX681 Thanks for clarifying the origin of the errors I am more than happy to provide the tag Tested-by: German <germanpapulindez@gmail.com> German
2026-09-10 11:53     ` Test on another machine and userspace for [PATCH v3 0/3] media: Add support for the Sony IMX681 German
2026-09-11  7:35       ` Krzysztof Kozlowski
2026-09-11  8:18       ` Sergey Lebedev
2026-09-11  8:50         ` Full name to validate the " German
2026-09-12 16:16 ` cause of the image error in Gnome Snapshot " German
2026-09-13  8:24   ` Sergey Lebedev
2026-09-13 18:18     ` Reply " German Pablo Lindo
2026-09-13 19:05       ` Sergey Lebedev

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=20260909204624.9A5E91F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lsa.uz@pm.me \
    --cc=media-ci@linuxtv.org \
    --cc=robh@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.