CEPH filesystem development
 help / color / mirror / Atom feed
* [PATCH v2 0/2] libceph: validate OSD sparse-read extent maps (+KUnit)
@ 2026-07-14 11:51 Michael Bommarito
  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
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Bommarito @ 2026-07-14 11:51 UTC (permalink / raw)
  To: Ilya Dryomov; +Cc: Viacheslav Dubeyko, ceph-devel, linux-kernel, stable

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-08-11 16:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-14 11:51 [PATCH v2 0/2] libceph: validate OSD sparse-read extent maps (+KUnit) Michael Bommarito
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
2026-08-11 16:55   ` Alex Markuze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox