From: sashiko-bot@kernel.org
To: "Gaobin Huang" <huanggaobin23@semi.ac.cn>
Cc: linux-cxl@vger.kernel.org
Subject: Re: [PATCH 1/2] cxl/mbox: clamp the event record count to the received payload
Date: Mon, 14 Sep 2026 13:16:33 +0000 [thread overview]
Message-ID: <20260914131633.C10161F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260914125701.1160136-2-huanggaobin23@semi.ac.cn>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but EDAC memory repair state storage is improperly gated behind a tracepoint condition, breaking memory repair when tracing is disabled.
--
commit 4e03b22d8d72d66a9d7ecd79d1ff3eb2082c4880
Author: Gaobin Huang <huanggaobin23@semi.ac.cn>
cxl/mbox: clamp the event record count to the received payload
This commit derives the event record bound from the mailbox command's
size_out to clamp the record count, preventing out-of-bounds reads when
the device returns a payload smaller than claimed.
> diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
> index 55828a836c01a..a8f51bf0ffc7c 100644
> --- a/drivers/cxl/core/mbox.c
> +++ b/drivers/cxl/core/mbox.c
[Severity: High]
This isn't a bug introduced by this patch, but while reviewing this file I
noticed EDAC memory repair state storage is improperly gated behind a
tracepoint condition in cxl_event_trace_record().
drivers/cxl/core/mbox.c:cxl_event_trace_record() {
...
if (trace_cxl_general_media_enabled() || trace_cxl_dram_enabled()) {
...
if (event_type == CXL_CPER_EVENT_GEN_MEDIA) {
if (cxl_store_rec_gen_media((struct cxl_memdev *)cxlmd, evt))
...
}
Because memory error records are only stored when tracepoints are active,
doesn't this break EDAC memory repair (like PPR or memory sparing) when
tracing is disabled, since the records will be silently dropped and
operations requiring them will abort with -EINVAL?
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260914125701.1160136-1-huanggaobin23@semi.ac.cn?part=1
next prev parent reply other threads:[~2026-09-14 13:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-14 12:56 [PATCH 0/2] cxl/mbox: bound device supplied counts by the received payload Gaobin Huang
2026-09-14 12:57 ` [PATCH 1/2] cxl/mbox: clamp the event record count to " Gaobin Huang
2026-09-14 13:16 ` sashiko-bot [this message]
2026-09-16 0:36 ` Jonathan Cameron
2026-09-17 11:01 ` 黄高彬
2026-09-16 1:07 ` Anisa Su
2026-09-14 12:57 ` [PATCH 2/2] cxl/mbox: bound the Get Supported Logs entry count by the payload Gaobin Huang
2026-09-16 0:42 ` Jonathan Cameron
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=20260914131633.C10161F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=huanggaobin23@semi.ac.cn \
--cc=linux-cxl@vger.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 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.