From: sashiko-bot@kernel.org
To: "Vikram Sharma" <vikram.sharma@oss.qualcomm.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 3/6] media: qcom: camss: Add Glymur compatible
Date: Fri, 29 May 2026 15:33:18 +0000 [thread overview]
Message-ID: <20260529153319.114FF1F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260529-glymur_camss-v1-3-bee535396d22@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Missing bounds check for device tree endpoint port number against `camss->res->csiphy_num` leads to out-of-bounds array access and memory corruption.
--
commit f84037afd7728553fdb93e0bd472a151b8696e13
Author: Prashant Shrotriya <pshrotri@qti.qualcomm.com>
media: qcom: camss: Add Glymur compatible
This commit adds the CAMSS_GLYMUR enum, the Glymur compatible string, and
the initial private data structure for the Glymur camss driver. The
resources will be populated in subsequent commits.
> diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
> --- a/drivers/media/platform/qcom/camss/camss.c
> +++ b/drivers/media/platform/qcom/camss/camss.c
> @@ -5507,6 +5507,11 @@ static void camss_remove(struct platform_device *pdev)
> camss_genpd_cleanup(camss);
> }
>
> +static const struct camss_resources glymur_resources = {
> + .version = CAMSS_GLYMUR,
> + .pd_name = "top",
> +};
[Severity: High]
This isn't a bug introduced by this patch, but is a pre-existing issue
affecting all supported SoCs.
In camss_parse_endpoint_node(), the device tree endpoint port number
(vep.base.port) is assigned to csd->interface.csiphy_id without verifying
if it is strictly less than camss->res->csiphy_num.
Later, when the external subdevice is bound, camss_subdev_notifier_bound()
uses this unchecked id to directly index the dynamically allocated
camss->csiphy array:
camss_subdev_notifier_bound() {
...
struct camss_csiphy_device *csiphy = &camss->csiphy[id];
...
csiphy->cfg.csi2 = &csd->interface.csi2;
...
}
If a device tree (including runtime DT overlays) defines an endpoint with an
abnormally high port number, could this unconditionally result in an
out-of-bounds write past the allocated block, leading to memory corruption?
While the specific 0-resource crash for the newly added Glymur driver in
this intermediate commit is resolved later in the patch series, the
underlying lack of bounds checking remains unfixed.
> +
> static const struct camss_resources msm8916_resources = {
> .version = CAMSS_8x16,
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260529-glymur_camss-v1-0-bee535396d22@oss.qualcomm.com?part=3
next prev parent reply other threads:[~2026-05-29 15:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-29 14:37 [PATCH 0/6] Add CAMSS support for Qualcomm Glymur Vikram Sharma
2026-05-29 14:37 ` [PATCH 1/6] dt-bindings: media: Add bindings for qcom,glymur-camss Vikram Sharma
2026-05-29 15:07 ` Bryan O'Donoghue
2026-05-29 14:37 ` [PATCH 2/6] dt-bindings: i2c: qcom-cci: Document Glymur compatible Vikram Sharma
2026-05-29 14:37 ` [PATCH 3/6] media: qcom: camss: Add " Vikram Sharma
2026-05-29 15:33 ` sashiko-bot [this message]
2026-05-29 14:37 ` [PATCH 4/6] media: qcom: camss: Add CSIPHY support for Glymur Vikram Sharma
2026-05-29 14:37 ` [PATCH 5/6] media: qcom: camss: enable vfe " Vikram Sharma
2026-05-29 14:50 ` Bryan O'Donoghue
2026-05-29 14:37 ` [PATCH 6/6] media: qcom: camss: Enumerate resources " Vikram Sharma
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=20260529153319.114FF1F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vikram.sharma@oss.qualcomm.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