From: Michael Bommarito <michael.bommarito@gmail.com>
To: Ilya Dryomov <idryomov@gmail.com>
Cc: Viacheslav Dubeyko <slava@dubeyko.com>,
ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: [PATCH v2 0/2] libceph: validate OSD sparse-read extent maps (+KUnit)
Date: Tue, 14 Jul 2026 07:51:38 -0400 [thread overview]
Message-ID: <20260714115141.3768034-1-michael.bommarito@gmail.com> (raw)
Patch 1 is the fix from v1 (unchanged), now carrying Viacheslav Dubeyko's
Reviewed-by. Patch 2 adds the KUnit coverage he asked for.
osd_sparse_read() checks that the sparse-read data length matches the summed
extent lengths but never checks that each OSD-supplied extent is monotonic
and stays inside the original request range, so a malformed authenticated
OSD reply can advance the message-data cursor past the request buffer and
hit the BUG_ON(!*length) in ceph_msg_data_next(). Patch 1 rejects such maps
before advancing the cursor.
The KUnit suite in patch 2 drives the real osd_sparse_read() state machine
over a synthesized reply (no OSD, no network). Confirmed before/after on
v7.2-rc3: without patch 1 the out-of-range case faults in
ceph_msg_data_next() while the in-range control passes (1 pass, 1 fail);
with patch 1 both pass.
v1: https://lore.kernel.org/ceph-devel/20260710022837.libceph-sparse-v1@bommarito/
Michael Bommarito (2):
libceph: validate OSD extent maps before cursor advance
libceph: add KUnit coverage for OSD sparse-read extent validation
net/ceph/Kconfig | 12 +++
net/ceph/osd_client-kunit.c | 146 ++++++++++++++++++++++++++++++++++++
net/ceph/osd_client.c | 34 +++++++++
3 files changed, 192 insertions(+)
create mode 100644 net/ceph/osd_client-kunit.c
--
2.53.0
next reply other threads:[~2026-07-14 11:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-14 11:51 Michael Bommarito [this message]
2026-07-14 11:51 ` [PATCH v2 1/2] libceph: validate OSD extent maps before cursor advance Michael Bommarito
2026-07-14 11:51 ` [PATCH v2 2/2] libceph: add KUnit coverage for OSD sparse-read extent validation Michael Bommarito
2026-07-14 17:43 ` Viacheslav Dubeyko
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=20260714115141.3768034-1-michael.bommarito@gmail.com \
--to=michael.bommarito@gmail.com \
--cc=ceph-devel@vger.kernel.org \
--cc=idryomov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=slava@dubeyko.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome