From: Jonathan Cameron <jonathan.cameron@huawei.com>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: <dave.jiang@intel.com>, <alison.schofield@intel.com>,
<vishal.l.verma@intel.com>, <ira.weiny@intel.com>,
<dan.j.williams@intel.com>, <linux-cxl@vger.kernel.org>
Subject: Re: [PATCH 2/2] cxl/mbox: return appropriate error in cxl_payload_from_user_allowed()
Date: Fri, 27 Feb 2026 13:38:16 +0000 [thread overview]
Message-ID: <20260227133816.00003a59@huawei.com> (raw)
In-Reply-To: <20260220001618.963490-3-dave@stgolabs.net>
On Thu, 19 Feb 2026 16:16:18 -0800
Davidlohr Bueso <dave@stgolabs.net> wrote:
> Make cxl_payload_from_user_allowed() return int such that the it can
> distinguish between different errors. The payload size failure is not
> well represented by EBUSY (exclusive access by the kernel).
>
> Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Hi Davidlohr,
If you are going to sneak in a fix to quotation style, then I'd like to see
it mentioned in the commit message.
Anyhow either way
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
> +static int cxl_payload_from_user_allowed(u16 opcode, void *payload_in,
> + size_t in_size)
> {
> switch (opcode) {
> case CXL_MBOX_OP_SET_PARTITION_INFO: {
> struct cxl_mbox_set_partition_info *pi = payload_in;
>
> if (in_size < sizeof(*pi))
> - return false;
> + return -EINVAL;
> if (pi->flags & CXL_SET_PARTITION_IMMEDIATE_FLAG)
> - return false;
> + return -EBUSY;
> break;
> }
> case CXL_MBOX_OP_CLEAR_LOG: {
> const uuid_t *uuid = (uuid_t *)payload_in;
>
> if (in_size < sizeof(uuid_t))
> - return false;
> + return -EINVAL;
> /*
> - * Restrict the ‘Clear log’ action to only apply to
> + * Restrict the 'Clear log' action to only apply to
Unrelated change. I don't mind it but should at least be mentioned.
Maybe Dave can add something to the commit description when picking this up.
> * Vendor debug logs.
> */
> - return uuid_equal(uuid, &DEFINE_CXL_VENDOR_DEBUG_UUID);
> + if (!uuid_equal(uuid, &DEFINE_CXL_VENDOR_DEBUG_UUID))
next prev parent reply other threads:[~2026-02-27 13:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-20 0:16 [PATCH 0/2] cxl/mbox: fix undersized payload handling in cxl_payload_from_user_allowed() Davidlohr Bueso
2026-02-20 0:16 ` [PATCH 1/2] cxl/mbox: validate payload size before accessing contents " Davidlohr Bueso
2026-02-23 19:23 ` Alison Schofield
2026-02-23 22:39 ` Dave Jiang
2026-02-20 0:16 ` [PATCH 2/2] cxl/mbox: return appropriate error " Davidlohr Bueso
2026-02-20 22:14 ` Alison Schofield
2026-02-21 18:55 ` Davidlohr Bueso
2026-02-23 19:27 ` Alison Schofield
2026-02-23 22:40 ` Dave Jiang
2026-02-27 13:38 ` Jonathan Cameron [this message]
2026-02-20 17:23 ` [PATCH 0/2] cxl/mbox: fix undersized payload handling " Dave Jiang
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=20260227133816.00003a59@huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=alison.schofield@intel.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=ira.weiny@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=vishal.l.verma@intel.com \
/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