From: "Wachowski, Karol" <karol.wachowski@linux.intel.com>
To: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>,
dri-devel@lists.freedesktop.org
Cc: oded.gabbay@gmail.com, jeff.hugo@oss.qualcomm.com,
lizhi.hou@amd.com, dawid.osuchowski@linux.intel.com,
stable@vger.kernel.org
Subject: Re: [PATCH] accel/ivpu: Add bounds checks for firmware log indices
Date: Tue, 2 Jun 2026 07:49:24 +0200 [thread overview]
Message-ID: <093b7951-a0f3-4935-adfa-dfd4fe45bea9@linux.intel.com> (raw)
In-Reply-To: <9c0b071d-efd0-4b89-9e75-78b8355d90d4@linux.intel.com>
On 29-May-26 14:06, Wachowski, Karol wrote:
> On 29-May-26 13:58, Andrzej Kacprowski wrote:
>> Add validation that read and write indices in the firmware log buffer
>> are within valid bounds (< data_size) before using them. If
>> out-of-bounds indices are encountered (from firmware), clamp them to
>> safe values instead of proceeding with invalid offsets.
>>
>> This prevents potential out-of-bounds buffer access when firmware
>> supplies invalid log indices.
>>
>> Fixes: 1fc1251149a7 ("accel/ivpu: Refactor functions in ivpu_fw_log.c")
>> Cc: <stable@vger.kernel.org> # v6.18+
>> Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
>
> Reviewed-by: Karol Wachowski <karol.wachowski@linux.intel.com>
>
Applied to drm-misc-fixes.
>> ---
>> drivers/accel/ivpu/ivpu_fw_log.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/drivers/accel/ivpu/ivpu_fw_log.c b/drivers/accel/ivpu/
>> ivpu_fw_log.c
>> index 337c906b0210..275baf844b56 100644
>> --- a/drivers/accel/ivpu/ivpu_fw_log.c
>> +++ b/drivers/accel/ivpu/ivpu_fw_log.c
>> @@ -98,6 +98,11 @@ static void fw_log_print_buffer(struct
>> vpu_tracing_buffer_header *log, const cha
>> u32 log_start = only_new_msgs ? READ_ONCE(log->read_index) : 0;
>> u32 log_end = READ_ONCE(log->write_index);
>> + if (log_start >= data_size)
>> + log_start = 0;
>> + if (log_end > data_size)
>> + log_end = data_size;
>> +
>> if (log->wrap_count == log->read_wrap_count) {
>> if (log_end <= log_start) {
>> drm_printf(p, "==== %s \"%s\" log empty ====\n", prefix,
>> log->name);
>
>
prev parent reply other threads:[~2026-06-02 5:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-29 11:58 [PATCH] accel/ivpu: Add bounds checks for firmware log indices Andrzej Kacprowski
2026-05-29 12:06 ` Wachowski, Karol
2026-06-02 5:49 ` Wachowski, Karol [this message]
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=093b7951-a0f3-4935-adfa-dfd4fe45bea9@linux.intel.com \
--to=karol.wachowski@linux.intel.com \
--cc=andrzej.kacprowski@linux.intel.com \
--cc=dawid.osuchowski@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jeff.hugo@oss.qualcomm.com \
--cc=lizhi.hou@amd.com \
--cc=oded.gabbay@gmail.com \
--cc=stable@vger.kernel.org \
/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.