<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/media/platform/qcom/iris/iris_buffer.c, branch linux-7.0.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-7.0.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-7.0.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-05-17T15:16:26+00:00</updated>
<entry>
<title>media: iris: Fix use-after-free in iris_release_internal_buffers()</title>
<updated>2026-05-17T15:16:26+00:00</updated>
<author>
<name>Dikshita Agarwal</name>
<email>dikshita.agarwal@oss.qualcomm.com</email>
</author>
<published>2026-02-16T07:07:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=18c64439f249859b6140f7bf8bcf95c8ed841f28'/>
<id>urn:sha1:18c64439f249859b6140f7bf8bcf95c8ed841f28</id>
<content type='text'>
commit f27cfdcfc916bb59297825805f4c3499f89f9e76 upstream.

The recent change in commit 1dabf00ee206 ("media: iris: gen1: Destroy
internal buffers after FW releases") introduced a regression where
session_release_buf() may free the buffer. The caller,
iris_release_internal_buffers(), continued to access `buffer` after the
call, leading to a potential use-after-free.

Fix this by setting BUF_ATTR_PENDING_RELEASE before calling
session_release_buf(), and reverting the flag if the call fails. This
ensures no dereference occurs after potential freeing.

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Closes: https://lore.kernel.org/lkml/aYXvKAX3Pg3sL37P@stanley.mountain/#r
Signed-off-by: Dikshita Agarwal &lt;dikshita.agarwal@oss.qualcomm.com&gt;
Reviewed-by: Vikash Garodia &lt;vikash.garodia@oss.qualcomm.com&gt;
Fixes: 1dabf00ee206 ("media: iris: gen1: Destroy internal buffers after FW releases")
Cc: stable@vger.kernel.org
Signed-off-by: Bryan O'Donoghue &lt;bod@kernel.org&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil+cisco@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Convert 'alloc_obj' family to use the new default GFP_KERNEL argument</title>
<updated>2026-02-22T01:09:51+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-02-22T00:37:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43'/>
<id>urn:sha1:bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43</id>
<content type='text'>
This was done entirely with mindless brute force, using

    git grep -l '\&lt;k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
        xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'

to convert the new alloc_obj() users that had a simple GFP_KERNEL
argument to just drop that argument.

Note that due to the extreme simplicity of the scripting, any slightly
more complex cases spread over multiple lines would not be triggered:
they definitely exist, but this covers the vast bulk of the cases, and
the resulting diff is also then easier to check automatically.

For the same reason the 'flex' versions will be done as a separate
conversion.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>treewide: Replace kmalloc with kmalloc_obj for non-scalar types</title>
<updated>2026-02-21T09:02:28+00:00</updated>
<author>
<name>Kees Cook</name>
<email>kees@kernel.org</email>
</author>
<published>2026-02-21T07:49:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=69050f8d6d075dc01af7a5f2f550a8067510366f'/>
<id>urn:sha1:69050f8d6d075dc01af7a5f2f550a8067510366f</id>
<content type='text'>
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:

Single allocations:	kmalloc(sizeof(TYPE), ...)
are replaced with:	kmalloc_obj(TYPE, ...)

Array allocations:	kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with:	kmalloc_objs(TYPE, COUNT, ...)

Flex array allocations:	kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with:	kmalloc_flex(*PTR, FAM, COUNT, ...)

(where TYPE may also be *VAR)

The resulting allocations no longer return "void *", instead returning
"TYPE *".

Signed-off-by: Kees Cook &lt;kees@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: iris: Add buffer to list only after successful allocation</title>
<updated>2026-01-20T13:00:12+00:00</updated>
<author>
<name>Dikshita Agarwal</name>
<email>dikshita.agarwal@oss.qualcomm.com</email>
</author>
<published>2025-12-29T06:31:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2d0bbd982dfdd67da488a772f7a8a1bdca7642bf'/>
<id>urn:sha1:2d0bbd982dfdd67da488a772f7a8a1bdca7642bf</id>
<content type='text'>
Move `list_add_tail()` to after `dma_alloc_attrs()` succeeds when creating
internal buffers. Previously, the buffer was enqueued in `buffers-&gt;list`
before the DMA allocation. If the allocation failed, the function returned
`-ENOMEM` while leaving a partially initialized buffer in the list, which
could lead to inconsistent state and potential leaks.

By adding the buffer to the list only after `dma_alloc_attrs()` succeeds,
we ensure the list contains only valid, fully initialized buffers.

Fixes: 73702f45db81 ("media: iris: allocate, initialize and queue internal buffers")
Reviewed-by: Bryan O'Donoghue &lt;bod@kernel.org&gt;
Signed-off-by: Dikshita Agarwal &lt;dikshita.agarwal@oss.qualcomm.com&gt;
Reviewed-by: Vikash Garodia &lt;vikash.garodia@oss.qualcomm.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Bryan O'Donoghue &lt;bod@kernel.org&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil+cisco@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: iris: Add support for QC08C format for encoder</title>
<updated>2025-11-06T10:18:09+00:00</updated>
<author>
<name>Dikshita Agarwal</name>
<email>dikshita.agarwal@oss.qualcomm.com</email>
</author>
<published>2025-10-08T09:52:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=456c99da41cb6f39c5c8420710b72fb9fd1450b4'/>
<id>urn:sha1:456c99da41cb6f39c5c8420710b72fb9fd1450b4</id>
<content type='text'>
Introduce handling for the QC08C format in the encoder. QC08C
format is NV12 with UBWC compression. Update format checks and
configuration to enable encoding to QC08C streams.

Signed-off-by: Dikshita Agarwal &lt;dikshita.agarwal@oss.qualcomm.com&gt;
Reviewed-by: Vikash Garodia &lt;vikash.garodia@oss.qualcomm.com&gt;
Signed-off-by: Bryan O'Donoghue &lt;bod@kernel.org&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil+cisco@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: iris: Add support for QC08C format for decoder</title>
<updated>2025-11-06T10:18:09+00:00</updated>
<author>
<name>Dikshita Agarwal</name>
<email>dikshita.agarwal@oss.qualcomm.com</email>
</author>
<published>2025-10-08T09:52:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cfd71b14b0d6f62d97338a524c858c63cf699c3f'/>
<id>urn:sha1:cfd71b14b0d6f62d97338a524c858c63cf699c3f</id>
<content type='text'>
Introduce handling for the QC08C format in the decoder. QC08C format is
NV12 with UBWC compression. Update format checks and configuration to
enable decoding of QC08C streams.

Signed-off-by: Dikshita Agarwal &lt;dikshita.agarwal@oss.qualcomm.com&gt;
Reviewed-by: Vikash Garodia &lt;vikash.garodia@oss.qualcomm.com&gt;
Signed-off-by: Bryan O'Donoghue &lt;bod@kernel.org&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil+cisco@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: iris: add VPU33 specific encoding buffer calculation</title>
<updated>2025-09-10T07:02:48+00:00</updated>
<author>
<name>Neil Armstrong</name>
<email>neil.armstrong@linaro.org</email>
</author>
<published>2025-09-02T08:43:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a5925a2ce0775374dcbbaf19826b539c2e9eec84'/>
<id>urn:sha1:a5925a2ce0775374dcbbaf19826b539c2e9eec84</id>
<content type='text'>
The VPU33 found in the SM8650 Platform requires some slighly different
buffer calculation for encoding to allow working with the latest
firwware uploaded on linux-firmware at [1].

[1] https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/?id=ece445af91bbee49bf0d8b23c2b99b596ae6eac7

Suggested-by: Vikash Garodia &lt;quic_vgarodia@quicinc.com&gt;
Signed-off-by: Neil Armstrong &lt;neil.armstrong@linaro.org&gt;
Reviewed-by: Vikash Garodia &lt;quic_vgarodia@quicinc.com&gt;
Signed-off-by: Bryan O'Donoghue &lt;bod@kernel.org&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil+cisco@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: iris: Allocate and queue internal buffers for encoder video device</title>
<updated>2025-09-10T07:02:45+00:00</updated>
<author>
<name>Dikshita Agarwal</name>
<email>quic_dikshita@quicinc.com</email>
</author>
<published>2025-08-25T07:00:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=61528e86687e3ba520d10a2be40d7e409cea663d'/>
<id>urn:sha1:61528e86687e3ba520d10a2be40d7e409cea663d</id>
<content type='text'>
Add support for allocating and queuing internal buffers required by the
encoder. The sizes of these buffers are derived from hardware
specifications and are essential to meet the encoder's functional and
performance requirements.

These buffers are not exposed to userspace; they are allocated and
managed internally to ensure correct and efficient hardware operation.

Tested-by: Vikash Garodia &lt;quic_vgarodia@quicinc.com&gt; # X1E80100
Reviewed-by: Vikash Garodia &lt;quic_vgarodia@quicinc.com&gt;
Tested-by: Neil Armstrong &lt;neil.armstrong@linaro.org&gt; # on SM8550-HDK
Tested-by: Neil Armstrong &lt;neil.armstrong@linaro.org&gt; # on SM8650-HDK
Signed-off-by: Dikshita Agarwal &lt;quic_dikshita@quicinc.com&gt;
Tested-by: Bryan O'Donoghue &lt;bryan.odonoghue@linaro.org&gt; # x1e80100-crd
[bod: added sm8750 enc_op_int_buf_tbl enumeration during merge]
Signed-off-by: Bryan O'Donoghue &lt;bod@kernel.org&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil+cisco@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: iris: Set platform capabilities to firmware for encoder video device</title>
<updated>2025-09-10T07:02:43+00:00</updated>
<author>
<name>Dikshita Agarwal</name>
<email>quic_dikshita@quicinc.com</email>
</author>
<published>2025-08-25T07:00:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d22037f3fd33e5956ecbc2ee38b42726fa2cc7a0'/>
<id>urn:sha1:d22037f3fd33e5956ecbc2ee38b42726fa2cc7a0</id>
<content type='text'>
Initialize and configure platform-specific capabilities for the encoder
in the firmware during stream-on, to tailor encoding behavior to the
current session's requirements. Some of these capabilities can also be
updated dynamically when V4L2 controls are modified by the client after
stream-on.

Tested-by: Vikash Garodia &lt;quic_vgarodia@quicinc.com&gt; # X1E80100
Reviewed-by: Vikash Garodia &lt;quic_vgarodia@quicinc.com&gt;
Tested-by: Neil Armstrong &lt;neil.armstrong@linaro.org&gt; # on SM8550-HDK
Tested-by: Neil Armstrong &lt;neil.armstrong@linaro.org&gt; # on SM8650-HDK
Signed-off-by: Dikshita Agarwal &lt;quic_dikshita@quicinc.com&gt;
Tested-by: Bryan O'Donoghue &lt;bryan.odonoghue@linaro.org&gt; # x1e80100-crd
Signed-off-by: Bryan O'Donoghue &lt;bod@kernel.org&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil+cisco@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: iris: Initialize and deinitialize encoder instance structure</title>
<updated>2025-09-10T07:02:35+00:00</updated>
<author>
<name>Dikshita Agarwal</name>
<email>quic_dikshita@quicinc.com</email>
</author>
<published>2025-08-25T07:00:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5ad964ad5656668399f00c76707f0d063b64a4b1'/>
<id>urn:sha1:5ad964ad5656668399f00c76707f0d063b64a4b1</id>
<content type='text'>
Introduce initialization and deinitialization for internal encoder
instance structure with necessary hooks.

Tested-by: Vikash Garodia &lt;quic_vgarodia@quicinc.com&gt; # X1E80100
Reviewed-by: Vikash Garodia &lt;quic_vgarodia@quicinc.com&gt;
Reviewed-by: Bryan O'Donoghue &lt;bryan.odonoghue@linaro.org&gt;
Tested-by: Neil Armstrong &lt;neil.armstrong@linaro.org&gt; # on SM8550-HDK
Tested-by: Neil Armstrong &lt;neil.armstrong@linaro.org&gt; # on SM8650-HDK
Signed-off-by: Dikshita Agarwal &lt;quic_dikshita@quicinc.com&gt;
Tested-by: Bryan O'Donoghue &lt;bryan.odonoghue@linaro.org&gt; # x1e80100-crd
Signed-off-by: Bryan O'Donoghue &lt;bod@kernel.org&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil+cisco@kernel.org&gt;
</content>
</entry>
</feed>
