From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A9341A262D for ; Sat, 6 Jun 2026 19:00:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780772447; cv=none; b=dYS2GciAbijFPEVSwkHafjmq9IyLCDkYagr2t6P5/s34WAAVmGiQovxLL6CBqrjLchr4qnV5w7sUBOO5wQuXrxrQRD6E1z8M2p3q2cwgiygDjrx22Oqbvd45o4LozTcZXvr0xWVuJpdD1Syu7feEQPQ1A0kWi+63TxuW0JE2fqw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780772447; c=relaxed/simple; bh=SB7Q4h1MSqAh0UeyNq9Vk1SWGT1nQgzgNaQF44rZQy0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rXDG3n1N+HZrgzLOSHXmBsyC50GUJru9Q086PjQJ11i5Jo7bpMW+CR1L0PKgFjfzjnPPykBJPTL7Hmm7nD5wLb7jEJZPQS9mE2BPp6+0bmfeFd6NHVkqLyDsq3Q+RUqlehA/Wv7ddgeYnrvg6UjBYKrE8gFm+hxF93krJylBKnc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=aA7OGTVL; arc=none smtp.client-ip=209.85.160.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aA7OGTVL" Received: by mail-qt1-f171.google.com with SMTP id d75a77b69052e-517a5cafc3dso7287171cf.3 for ; Sat, 06 Jun 2026 12:00:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780772444; x=1781377244; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mql0QQ+9J26Gk5KyJRUIzwd78adrG9s2r831auI4Ui8=; b=aA7OGTVLrMjR2Crnk2XybjO9444dGr/pDZ33mkjZNVcQLpGtroxPZO1KPQSSAVtXvn MTHkt+DZFZ3KFHC1h07TLgogQeUURDX9JaBacX7140e3JL+liO0RC7qT6WqSfIvvJSgE aZ57EcU/Jb8c699zIfJ2FbYWDYd8q2EWgFb6L3PAkwgS7dbPc3CIuR7/IkxIvuvxlPJd jOD7GYu5FGZbgyxeN4Z4gKFzvEsa8BlVHVdXxNZw10bwJ6GvfKdrvU2G5zPnR0QmHMzN 66Oxww1awOREj2RmcMT+1ly91FgXOmWlXrmC0xLr2tijGRNuiPMkdQu6mrx1TvWUBmRr ZAKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780772444; x=1781377244; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=mql0QQ+9J26Gk5KyJRUIzwd78adrG9s2r831auI4Ui8=; b=R/fmKSyN2uAoHuCQocT+gLvdW5VcSfIO3atpQZlhLd03bFbF3pM2OJ8hJOvx8MCvIl 1OC8Gr+Y2+PoLqzBNzfEydQo8f1SwFtaRwzWfMm2F+sXw7VQ6f+fXBvkCrLxJn2efMqH EpeWKttHrnhKdOmUMwkArqAaktQv+Bzqz5PQ5hAS22XxSZPhfw3ZwzWoSUUvd5pn2hep +oSMJLs+xeHuVgaq914jgqlTHcjoEwZbwdoLOd8bqw7Jis9ZQguWQeQizI2/2h94XZWb IBjpOT9LUna2z+7+zIBDQlFU5ZcZlEBDdh3hm9sUYmloSiEBVgh6KaIt6GJqHaL/kCNJ DxeQ== X-Forwarded-Encrypted: i=1; AFNElJ+40Du8rLBAGEAXGEppLIzgz71/2qDsZNs0P2BFDr+ZWPRk2gVQPXv6bQHG9QQNXIOE7OVlslli5uLtAfM=@vger.kernel.org X-Gm-Message-State: AOJu0YyrClMyiZtBYS3VWHGWMfyExJTlWHS9UAawuM3/Z2B2TdcK/3ih qf8TL4WZt0c/hfkSjT0eK/exPpPMVLDhrCB6a6Ecn2Ry9aVAJwbb3Bex X-Gm-Gg: Acq92OF9CkvrBERQCy9Co3+kK+KQVnI8OgT8d0g4c+tpYpCCJxlr/v3teA4w9ENu/mB Ta3k8iyg3QUgQR685AzzMbBKMWcvbC/gTlyF0q/SitGmwutA1KX5aMrH7uiyl1k4/95T9plqywL 4dL80ALsYrhu7wvAclBYMeGiLHrTfi5jZXdO7l75NR9H6x94J4/rTWv0qd9m8X8Vfq7RluSNOxB bI4maFOsQJ5hY2h820l+rsz/4caZJJv+lhkwa63fa9usMLf+IRtVL8trSb+E9/4ia+ALNUMNaOs r4LdBrAZMWV6HcZradlHToyFi5XIGfXda5f5NuAxcj7Q8/ByfUocCHZiMdHnubUJV6EoqQ5Gqjg gKVRHrVF+SRqTPnNSWpprh11BFVW1v0InkSTCuyW7sDQ+0ZYDkiJ3EeXpfHQca0X6t08PjSn3FN IZaQTUicUX7J1oGFtk26xAehBqlqSWgmCCagDwh03Rz6WI1IXBeFAD/LFLIL21pvAcBVvfujAR7 /9gvY0LEh+5y8RkYJKh6gxSKFV22es= X-Received: by 2002:a05:622a:4d09:b0:516:e290:991a with SMTP id d75a77b69052e-51795be8192mr142753111cf.40.1780772444140; Sat, 06 Jun 2026 12:00:44 -0700 (PDT) Received: from server0 (c-68-48-65-54.hsd1.mi.comcast.net. [68.48.65.54]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-5179dd9d908sm40084581cf.15.2026.06.06.12.00.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jun 2026 12:00:43 -0700 (PDT) From: Michael Bommarito To: Ilya Dryomov , Alex Markuze , Viacheslav Dubeyko Cc: ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/4] ceph: bound untrusted MDS and monitor reply decoders Date: Sat, 6 Jun 2026 15:00:21 -0400 Message-ID: X-Mailer: git-send-email 2.53.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7bit This is v2 of the CephFS decoder-bound series. The first two patches are unchanged code-wise and now carry Slava's Reviewed-by. Patches 3 and 4 address the review feedback on overflow-safe sizing and aggregate delegated inode bounds. The four bugs are still independent: 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 bounds delegated-inode parsing by session population and by one reply's aggregate interval length. Changes in v2: - Add Reviewed-by: Viacheslav Dubeyko to patches 1 and 2. - Patch 3 computes the export-targets byte count with size_mul() and reuses the checked length for the cursor advance. - Patch 4 replaces the per-interval cap with a per-session population counter and a per-reply interval budget, so repeated replies and duplicate ranges are bounded too. The cap stays a fixed client-side constant because the kernel client never sees the userspace mds_client_prealloc_inos option; it is sized as a generous multiple of that option's documented default of 1000. 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 | 59 ++++++++++++++++++++++++++++++++++++++------ fs/ceph/mds_client.h | 1 + fs/ceph/mdsmap.c | 7 +++++- fs/ceph/super.h | 9 +++++++ fs/ceph/xattr.c | 1 + 5 files changed, 68 insertions(+), 9 deletions(-) base-commit: f72c95f3a516d87483e225ae081a402a09fd0127 -- 2.53.0