From: sashiko-bot@kernel.org
To: "Loic Poulain" <loic.poulain@oss.qualcomm.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org,
media-ci@linuxtv.org
Subject: Re: [PATCH v11 4/9] media: uapi: Add CAMSS ISP configuration definition
Date: Fri, 23 Oct 2026 15:26:49 +0000 [thread overview]
Message-ID: <sashiko-outbox-182905@kernel.org> (raw)
In-Reply-To: <20261023-camss-isp-ope-v11-4-0c2937195298@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] media: uapi: 1-based camss_params_block_type breaks v4l2-isp validation
--
commit 5063b494328e812916323b381b136d2e5d3ac987
Author: Loic Poulain <loic.poulain@oss.qualcomm.com>
media: uapi: Add CAMSS ISP configuration definition
This commit adds the UAPI header qcom-camss-config.h defining the ISP
parameter structures and shared block type identifiers for the CAMSS
Offline Processing Engine (OPE) driver.
> diff --git a/include/uapi/linux/qcom-camss-config.h b/include/uapi/linux/qcom-camss-config.h
> new file mode 100644
> index 0000000000000..5756d165e7e87
> --- /dev/null
> +++ b/include/uapi/linux/qcom-camss-config.h
> @@ -0,0 +1,212 @@
> +/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
> +/*
> + * Qualcomm CAMSS ISP Driver - Userspace API
> + *
> + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
> + */
> +
> +#ifndef _UAPI_LINUX_QCOM_CAMSS_CONFIG_H
> +#define _UAPI_LINUX_QCOM_CAMSS_CONFIG_H
> +
> +#include <linux/types.h>
> +#include <linux/media/v4l2-isp.h>
> +
> +/**
> + * enum camss_params_block_type - CAMSS ISP parameter block identifiers
> + *
> + * Each value identifies one ISP processing block. The value is placed in
> + * the @type field of &struct v4l2_isp_block_header.
> + *
> + * @CAMSS_PARAMS_WB_GAIN: white balance gains and offsets (CLC_WB),
> + * &struct camss_params_wb_gain
> + * @CAMSS_PARAMS_CHROMA_ENHAN: RGB to YUV colour transfer matrix
> + * (CLC_CHROMA_ENHAN), &struct camss_params_chroma_enhan
> + * @CAMSS_PARAMS_COLOR_CORRECT: colour correction matrix (CLC_CC),
> + * &struct camss_params_color_correct
> + * @CAMSS_PARAMS_GAMMA: per-channel gamma correction curves (CLC_GLUT),
> + * &struct camss_params_gamma
> + */
> +enum camss_params_block_type {
> + CAMSS_PARAMS_WB_GAIN = 1,
> + CAMSS_PARAMS_CHROMA_ENHAN = 2,
> + CAMSS_PARAMS_COLOR_CORRECT = 3,
> + CAMSS_PARAMS_GAMMA = 4,
> +};
[Severity: High]
Starting enum camss_params_block_type at 1 (and sharing the enum across
ISPs that may only populate a subset of blocks in their
v4l2_isp_params_block_type_info array) leaves index 0 and any unsupported
block indices zero-initialized with info->size == 0.
In drivers/media/v4l2-core/v4l2-isp.c:v4l2_isp_params_validate_buffer():
info = &type_info[block->type];
if (block->size != info->size &&
(!(block->flags & V4L2_ISP_PARAMS_FL_BLOCK_DISABLE) ||
block->size != sizeof(*block))) {
dev_dbg(dev,
"Invalid block size %u (expected %zu) at offset %zu\n",
block->size, info->size, block_offset);
return -EINVAL;
}
if (info->block_validate && info->block_validate(dev, block))
return -EINVAL;
block_offset += block->size;
buffer_size -= block->size;
If userspace queues a parameter buffer with data_size >=
sizeof(struct v4l2_isp_block_header) containing a zeroed block header
(type = 0, flags = 0, size = 0), block->type passes the bounds check and
block->size != info->size evaluates 0 != 0 (false). Because block->size is
0, block_offset and buffer_size never advance in the validation loop,
causing an infinite loop in the kernel.
Additionally, if userspace submits block->type = 0 with
V4L2_ISP_PARAMS_FL_BLOCK_DISABLE and block->size == sizeof(*block),
v4l2_isp_params_validate_buffer() accepts the unpopulated block type 0 as
valid.
Should enum camss_params_block_type start at 0 like other V4L2 ISP block
type enums, or should v4l2_isp_params_validate_buffer() also reject
entries where info->size == 0?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261023-camss-isp-ope-v11-0-0c2937195298@oss.qualcomm.com?part=4
next prev parent reply other threads:[~2026-10-23 15:26 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-23 15:09 [PATCH v11 0/9] media: qcom: camss: CAMSS Offline Processing Engine support Loic Poulain
2026-10-23 15:09 ` [PATCH v11 1/9] media: qcom: camss: Add V4L2 meta format for CAMSS ISP parameters Loic Poulain
2026-10-26 14:34 ` johannes.goede
2026-10-23 15:09 ` [PATCH v11 2/9] dt-bindings: media: qcom: Add CAMSS Offline Processing Engine (OPE) Loic Poulain
2026-10-23 15:09 ` [PATCH v11 3/9] dt-bindings: media: qcom,qcm2290-camss-ope: Document shikra compatible Loic Poulain
2026-10-23 15:16 ` Loic Poulain
2026-10-23 15:09 ` [PATCH v11 4/9] media: uapi: Add CAMSS ISP configuration definition Loic Poulain
2026-10-23 15:26 ` sashiko-bot [this message]
2026-10-26 14:37 ` johannes.goede
2026-10-23 15:09 ` [PATCH v11 5/9] media: Documentation: uapi: Add qcom-camss ISP params documentation Loic Poulain
2026-10-26 14:42 ` johannes.goede
2026-10-23 15:09 ` [PATCH v11 6/9] media: qcom: camss: Add CAMSS Offline Processing Engine driver Loic Poulain
2026-10-23 15:09 ` [PATCH v11 7/9] arm64: dts: qcom: agatti: Add OPE node Loic Poulain
2026-10-23 15:48 ` sashiko-bot
2026-10-23 15:09 ` [PATCH v11 8/9] arm64: dts: qcom: shikra: " Loic Poulain
2026-10-23 15:09 ` [PATCH v11 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=sashiko-outbox-182905@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