Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Loic Poulain" <loic.poulain@oss.qualcomm.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org,
	media-ci@linuxtv.org
Subject: Re: [PATCH v8 5/9] media: Documentation: uapi: Add qcom-camss ISP params documentation
Date: Mon, 21 Sep 2026 15:45:24 +0000	[thread overview]
Message-ID: <20260921154525.532E31F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260921-camss-isp-ope-v8-5-dd1c86a3c8a0@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] doc: userspace example crashes under _FORTIFY_SOURCE due to __counted_by
--

commit 051ac0c97fb5f4276626ca22d484402bd8d6a07a
Author: Loic Poulain <loic.poulain@oss.qualcomm.com>

media: Documentation: uapi: Add qcom-camss ISP params documentation

Add documentation for the Qualcomm CAMSS ISP parameters metadata format.
The patch defines parameter structures and includes a code example to
illustrate populating the buffer for the OPE processing pipeline.

> diff --git a/Documentation/userspace-api/media/v4l/metafmt-qcom-isp.rst b/Documentation/userspace-api/media/v4l/metafmt-qcom-isp.rst
> new file mode 100644
> index 0000000000000..5e1fd5814ff78
> --- /dev/null
> +++ b/Documentation/userspace-api/media/v4l/metafmt-qcom-isp.rst

[ ... ]

> +	struct v4l2_isp_params_buffer *params =
> +		(struct v4l2_isp_params_buffer *)buffer;
> +
> +	params->version = V4L2_ISP_PARAMS_VERSION_V1;
> +	params->data_size = 0;
> +
> +	void *data = (void *)params->data;
> +
> +	struct camss_params_wb_gain *wb =
> +		(struct camss_params_wb_gain *)data;
> +
> +	memset(wb, 0, sizeof(*wb));
> +	wb->header.type = CAMSS_PARAMS_WB_GAIN;
> +	wb->header.flags = V4L2_ISP_PARAMS_FL_BLOCK_ENABLE;
> +	wb->header.size = sizeof(struct camss_params_wb_gain);
> +
> +	/* Unity gain on all three channels (15uQ10, 1024 = 1.0) */
> +	wb->g_gain = 1024;
> +	wb->b_gain = 1024;
> +	wb->r_gain = 1024;
> +
> +	data += sizeof(struct camss_params_wb_gain);
> +	params->data_size += sizeof(struct camss_params_wb_gain);

[Severity: Medium]
Could this example code crash userspace applications compiled with modern
compiler protections like _FORTIFY_SOURCE=3?

The v4l2_isp_params_buffer struct uses the __counted_by(data_size) attribute
for its data flexible array. Setting data_size to 0 and then writing to the
array elements (via memset) before updating data_size will cause dynamic
object size tracking to see an allocation of size 0, leading to a runtime
bounds-checking abort.

Additionally, does this snippet rely on non-standard pointer arithmetic?

The data pointer is declared as a void *, and incrementing it directly
using data += sizeof(struct camss_params_wb_gain) is a GCC extension rather
than standard C.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260921-camss-isp-ope-v8-0-dd1c86a3c8a0@oss.qualcomm.com?part=5

  reply	other threads:[~2026-09-21 15:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-21 15:36 [PATCH v8 0/9] media: qcom: camss: CAMSS Offline Processing Engine support Loic Poulain
2026-09-21 15:36 ` [PATCH v8 1/9] media: qcom: camss: Add V4L2 meta format for CAMSS ISP parameters Loic Poulain
2026-09-21 15:36 ` [PATCH v8 2/9] dt-bindings: media: qcom: Add CAMSS Offline Processing Engine (OPE) Loic Poulain
2026-09-21 15:36 ` [PATCH v8 3/9] dt-bindings: media: qcom,qcm2290-camss-ope: Document shikra compatible Loic Poulain
2026-09-21 15:36 ` [PATCH v8 4/9] media: uapi: Add CAMSS ISP configuration definition Loic Poulain
2026-09-21 15:36 ` [PATCH v8 5/9] media: Documentation: uapi: Add qcom-camss ISP params documentation Loic Poulain
2026-09-21 15:45   ` sashiko-bot [this message]
2026-09-21 15:36 ` [PATCH v8 6/9] media: qcom: camss: Add CAMSS Offline Processing Engine driver Loic Poulain
2026-09-21 16:01   ` sashiko-bot
2026-09-21 15:36 ` [PATCH v8 7/9] arm64: dts: qcom: agatti: Add OPE node Loic Poulain
2026-09-21 15:36 ` [PATCH v8 8/9] arm64: dts: qcom: shikra: " Loic Poulain
2026-09-21 15:36 ` [PATCH v8 9/9] arm64: defconfig: Enable Qualcomm CAMSS OPE driver Loic Poulain

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=20260921154525.532E31F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=loic.poulain@oss.qualcomm.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox