From: sashiko-bot@kernel.org
To: "Andrew Stellman" <astellman@stellman-greene.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH rdma-rc] RDMA/siw: Honor the sg_offset in siw_map_mr_sg()
Date: Sun, 22 Nov 2026 19:16:45 +0000 [thread overview]
Message-ID: <sashiko-outbox-228240@kernel.org> (raw)
In-Reply-To: <20261122191128.65369-1-astellman@stellman-greene.com>
> siw_map_mr_sg() builds the first PBL entry from sg_dma_address() and
> sg_dma_len() of the first scatterlist entry and ignores *sg_off.
> ib_sg_to_pages() includes *sg_off in mr->iova, which siw stores as
> mem->va, so siw_pbl_get_buffer() resolves an address in the MR to a
> location *sg_off bytes before it. rdma_rw_ctx_init() passes its
> sg_offset to ib_map_mr_sg(), and isert can pass a nonzero offset.
>
> A test module registered a one page buffer on siw with ib_map_mr_sg()
> and sg_offset 0x200, which gave mr->iova at page offset 0x200 and
> mr->length 3584. A user space client then wrote 16 bytes with an RDMA
> WRITE at mr->iova. The bytes landed at page offset 0x000 of the buffer
> instead of 0x200. With sg_offset 0 they landed at page offset 0x000,
> as expected.
>
> Start the first PBL entry *sg_off bytes into the first scatterlist
> entry, and reject an offset past the end of that entry, as
> ib_sg_to_pages() does. With this change the bytes land at page offset
> 0x200.
>
> The issue was found by Claude Opus 5.5 running Quality Playbook, an
> LLM-driven code review tool:
> https://github.com/andrewstellman/quality-playbook
> The fix and this changelog were drafted with Claude Opus 5.5 and
> reviewed by me.
>
> Fixes: 303ae1cdfdf7 ("rdma/siw: application interface")
> Signed-off-by: Andrew Stellman <astellman@stellman-greene.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261122191128.65369-1-astellman@stellman-greene.com?part=1
prev parent reply other threads:[~2026-11-22 19:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-22 19:11 [PATCH rdma-rc] RDMA/siw: Honor the sg_offset in siw_map_mr_sg() Andrew Stellman
2026-11-22 19:16 ` sashiko-bot [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=sashiko-outbox-228240@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=astellman@stellman-greene.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