From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 886EB355036; Wed, 3 Dec 2025 16:15:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764778549; cv=none; b=owsserzUrKnZPmy7ArewVpZkW30DH0g6Kl1GRzDDbu0DkRnQOdsMnLRj4/DZ8bq08K4GfLoKpTi8IszbFsdY95YPQlVyeWCzd9EqLOYn5+uUrgrxSCYXwYrRmUQFz0MWkH/5hN4p9eInsl5OIZmex4e5cSeZCjwtAU6duYiyhz8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764778549; c=relaxed/simple; bh=QWqftH63UxEz0S9pAKT69cEHD5AY9SGUv2NvAg75S98=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qKerjAsO6BcLjt69JfoMXdn8ZQ6tl2/cb7BzBei+eNxyiIHSpvVvqM3p2aDOH0Vvs47dzkXUEV5GItLNHLI0NwtECfEeD81DcgZCjHOqXcvqWf6hnHscWewp7wGqYPslivZC6t5bYF2BnHe/aSAl/osF4YHae21AbnEA6eV2b4k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=E2z36tvO; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="E2z36tvO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1B2FC4CEF5; Wed, 3 Dec 2025 16:15:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1764778549; bh=QWqftH63UxEz0S9pAKT69cEHD5AY9SGUv2NvAg75S98=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E2z36tvOWydc8j3mjCacG4U8F79sGVlZjQGd9jr8JO3pjXdiHBYZ+USkPLFrKhjhu YABUeODY0B/wyEb4x0RrL5Qv0hawkz2mEyfM6JR9TcQYHeusnQBF08Xok9w6o/4+V2 +R6WbtmktQ3qny4CLcn9dvxs7jP6P8l7z8aNDPmo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, ziming zhang , Ilya Dryomov Subject: [PATCH 5.15 378/392] libceph: prevent potential out-of-bounds writes in handle_auth_session_key() Date: Wed, 3 Dec 2025 16:28:48 +0100 Message-ID: <20251203152428.063841766@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251203152414.082328008@linuxfoundation.org> References: <20251203152414.082328008@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: ziming zhang commit 7fce830ecd0a0256590ee37eb65a39cbad3d64fc upstream. The len field originates from untrusted network packets. Boundary checks have been added to prevent potential out-of-bounds writes when decrypting the connection secret or processing service tickets. [ idryomov: changelog ] Cc: stable@vger.kernel.org Signed-off-by: ziming zhang Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov Signed-off-by: Greg Kroah-Hartman --- net/ceph/auth_x.c | 2 ++ 1 file changed, 2 insertions(+) --- a/net/ceph/auth_x.c +++ b/net/ceph/auth_x.c @@ -631,6 +631,7 @@ static int handle_auth_session_key(struc /* connection secret */ ceph_decode_32_safe(p, end, len, e_inval); + ceph_decode_need(p, end, len, e_inval); dout("%s connection secret blob len %d\n", __func__, len); if (len > 0) { dp = *p + ceph_x_encrypt_offset(); @@ -648,6 +649,7 @@ static int handle_auth_session_key(struc /* service tickets */ ceph_decode_32_safe(p, end, len, e_inval); + ceph_decode_need(p, end, len, e_inval); dout("%s service tickets blob len %d\n", __func__, len); if (len > 0) { ret = ceph_x_proc_ticket_reply(ac, &th->session_key,