From: Michael Bommarito <michael.bommarito@gmail.com>
To: Ilya Dryomov <idryomov@gmail.com>,
Alex Markuze <amarkuze@redhat.com>,
Viacheslav Dubeyko <slava@dubeyko.com>
Cc: ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v3 0/4] ceph: bound untrusted MDS and monitor reply decoders
Date: Tue, 7 Jul 2026 14:05:56 -0400 [thread overview]
Message-ID: <cover.1783447231.git.michael.bommarito@gmail.com> (raw)
This is v3 of the CephFS decoder-bound series. The four bugs are
independent; each bounds an untrusted length or count that a malicious or
compromised MDS or monitor controls on the wire.
1/4 rejects a final xattr value length that runs past the xattr blob.
2/4 bounds MDSCapAuth path and fs_name copies in handle_session().
3/4 bounds the mdsmap export_targets array for info_v 2/3.
4/4 caps delegated-inode parsing by per-session population and by one
reply's aggregate interval length.
Patches 1/4 and 2/4 carry Viacheslav Dubeyko's Reviewed-by from v1. Patch
3/4 carries his Reviewed-by from v2. Patch 4/4 is reworked to address his
v2 review, described below.
Changes in v3:
- Rebased onto ceph/testing (base-commit fc67edb66b3c9 below); v2 no
longer applied there. The series applies cleanly with git am on that
base. Patches 1-3 are unchanged apart from the rebase.
- Patch 4/4 reworked per review of v2:
- The per-session count is now enforced in a single place,
ceph_insert_deleg_ino(), using atomic_add_unless() rather than an
increment-then-decrement pattern. Since that helper is the only
caller that grows the count, the per-session population can never
exceed CEPH_MAX_DELEG_INOS, so the separate per-session pre-check in
the decode loop is dropped.
- The per-reply aggregate check is kept. It is the bound that stops one
reply from spinning the insert loop on duplicate ranges without
growing the per-session count, which the per-insert cap alone does
not catch.
- CEPH_MAX_DELEG_INOS is cast to u64 where it is compared against and
subtracted from the u64 interval length.
- The redundant warning in the decode loop is removed;
ceph_insert_deleg_ino() already logs when the cap is reached, and the
warnings now report the counts involved.
Michael Bommarito (4):
ceph: bound xattr value length in __build_xattrs()
ceph: bound MDSCapAuth path and fs_name decode in handle_session()
ceph: bound num_export_targets array for mds info v2/v3
ceph: cap delegated inode count in ceph_parse_deleg_inos()
fs/ceph/mds_client.c | 67 ++++++++++++++++++++++++++++++++++++++------
fs/ceph/mds_client.h | 1 +
fs/ceph/mdsmap.c | 7 ++++-
fs/ceph/super.h | 9 ++++++
fs/ceph/xattr.c | 1 +
5 files changed, 76 insertions(+), 9 deletions(-)
base-commit: fc67edb66b3c9924c4e0bb366a92b32ea13c526a
--
2.53.0
next reply other threads:[~2026-07-07 18:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-07 18:05 Michael Bommarito [this message]
2026-07-07 18:05 ` [PATCH v3 1/4] ceph: bound xattr value length in __build_xattrs() Michael Bommarito
2026-07-07 18:05 ` [PATCH v3 2/4] ceph: bound MDSCapAuth path and fs_name decode in handle_session() Michael Bommarito
2026-07-07 18:05 ` [PATCH v3 3/4] ceph: bound num_export_targets array for mds info v2/v3 Michael Bommarito
2026-07-07 18:06 ` [PATCH v3 4/4] ceph: cap delegated inode count in ceph_parse_deleg_inos() Michael Bommarito
2026-07-07 18:30 ` 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=cover.1783447231.git.michael.bommarito@gmail.com \
--to=michael.bommarito@gmail.com \
--cc=amarkuze@redhat.com \
--cc=ceph-devel@vger.kernel.org \
--cc=idryomov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=slava@dubeyko.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