From: sashiko-bot@kernel.org
To: "Abhijit Gangurde" <abhijit.gangurde@amd.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [for-next v4 3/5] RDMA/ionic: map PHC state into user space
Date: Fri, 30 Oct 2026 04:54:26 +0000 [thread overview]
Message-ID: <sashiko-outbox-190465@kernel.org> (raw)
In-Reply-To: <20260610154216.712374-4-abhijit.gangurde@amd.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Critical] Unconstrained ib_copy_to_udata causes out-of-bounds write in userspace memory and ABI breakage.
--
commit 92d10c24093a8b27cdd06722f8f50e627c7ca437
Author: Abhijit Gangurde <abhijit.gangurde@amd.com>
RDMA/ionic: map PHC state into user space
This commit enables user space applications to access the PHC state page
when firmware RDMA completion timestamping is supported. It maps the PHC
state into user space to allow timestamp conversion without kernel
transitions.
> diff --git a/include/uapi/rdma/ionic-abi.h b/include/uapi/rdma/ionic-abi.h
> index 7b589d3e9728e..2c70ac149c4ff 100644
> --- a/include/uapi/rdma/ionic-abi.h
> +++ b/include/uapi/rdma/ionic-abi.h
> @@ -48,6 +48,7 @@ struct ionic_ctx_resp {
> __u8 expdb_qtypes;
>
> __u8 rsvd2[3];
> + __aligned_u64 phc_offset;
> };
[Severity: Critical]
Does adding phc_offset to ionic_ctx_resp break userspace ABI backward
compatibility and cause an out-of-bounds write in userspace memory?
Looking at ionic_alloc_ucontext() in ionic_controlpath.c, the driver copies
the response to userspace using the new, larger struct size:
rc = ib_copy_to_udata(udata, &resp, sizeof(resp));
Since this commit increases the size of struct ionic_ctx_resp from 32 bytes
to 40 bytes, and the copy uses sizeof(resp) without restricting the length
to udata->outlen, won't older userspace binaries passing an outlen of 32
receive 40 bytes?
This appears to directly pass the larger length to copy_to_user() via
ib_copy_to_udata(), potentially overflowing the userspace application's
stack or heap buffer. Should the copy length be bounded by udata->outlen
to safely support older userspace clients?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260610154216.712374-1-abhijit.gangurde@amd.com?part=3
next prev parent reply other threads:[~2026-10-30 4:54 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-10 15:42 [for-next v4 0/5] ionic: RDMA completion timestamping support Abhijit Gangurde
2026-06-10 15:42 ` [for-next v4 1/5] net: ionic: register PHC for rdma timestamping Abhijit Gangurde
2026-10-30 4:54 ` sashiko-bot
2026-06-10 15:42 ` [for-next v4 2/5] net: ionic: Add PHC state page for user space access Abhijit Gangurde
2026-10-30 4:54 ` sashiko-bot
2026-06-10 15:42 ` [for-next v4 3/5] RDMA/ionic: map PHC state into user space Abhijit Gangurde
2026-10-30 4:54 ` sashiko-bot [this message]
2026-06-10 15:42 ` [for-next v4 4/5] RDMA/ionic: add completion timestamp to CQE format Abhijit Gangurde
2026-10-30 4:54 ` sashiko-bot
2026-06-10 15:42 ` [for-next v4 5/5] RDMA/mlx5: move mlx5 clock info to common struct ib_uverbs_clock_info Abhijit Gangurde
2026-07-15 13:08 ` [for-next v4 0/5] ionic: RDMA completion timestamping support Abhijit Gangurde
2026-07-16 8:01 ` Leon Romanovsky
2026-07-16 8:56 ` Abhijit Gangurde
2026-07-16 9:19 ` Leon Romanovsky
2026-07-22 8:45 ` Abhijit Gangurde
2026-07-22 8:55 ` Leon Romanovsky
2026-07-22 8:56 ` Leon Romanovsky
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-190465@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=abhijit.gangurde@amd.com \
--cc=linux-rdma@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox