From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RDNS_NONE autolearn=no autolearn_force=no version=3.4.1 From: Alexey Shabalin To: devel-kernel@altlinux.org Date: Wed, 18 Nov 2026 17:49:06 +0300 Message-ID: <20261118144935.3872281-1-shaba@altlinux.org> X-Mailer: git-send-email 2.50.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [d-kernel] [PATCH v2 6.12/sisyphus 0/29] libceph: add support for AES256KRB5 (aes256k) cephx keys X-BeenThere: devel-kernel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux kernel packages development List-Id: ALT Linux kernel packages development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Nov 2026 14:49:37 -0000 Archived-At: List-Archive: List-Post: Ceph 19.2.6+ generates cephx keys in the new AES256KRB5 (aes256k) format by default, following CVE-2025-30156 (AES-CBC misuse in CephX). The kernel client, however, accepts only the legacy CEPH_CRYPTO_AES keys, so mounting any such cluster with mount -t ceph fails with EINVAL ("libceph: secret too big 32"). https://bugzilla.altlinux.org/61355 This series backports the upstream CEPH_CRYPTO_AES256KRB5 support (merged in v7.0-rc1 via the "ceph-for-7.0-rc1" pull: https://lore.kernel.org/all/20260217173743.1840319-1-idryomov@gmail.com/) to 6.12. It consists of: - the crypto/krb5 library (the upstream v6.14 series plus follow-up fixes, as present in 6.18) and its prerequisite "lib/scatterlist: Add SG_MITER_LOCAL and use it" (v6.15); the rxrpc parts of the follow-up fixes are omitted, as noted in the commit messages - the libceph series from Ilya Dryomov, leading up to "libceph: add support for CEPH_CRYPTO_AES256KRB5" The upstream commit "libceph: Use HMAC-SHA256 library instead of crypto_shash" (27c0a7b05d13) is not applicable as-is because it depends on the crypto/sha2.h restructuring introduced between 6.13 and 6.15; ceph_hmac_sha256() stays crypto_shash-based and returns an error instead, with ceph_crypto_key carrying hmac_tfm rather than a precomputed hmac_key. This is noted in the adapted commit. Changes since v1: - add Signed-off-by from the sender to every patch, as requested - no code changes Testing: kernel-image-6.12 with this series was built and tested against a Ceph 20.2.5-alt1 (tentacle) cluster: - the stock kernel fails to mount with "libceph: secret too big 32" - with this series, mount -t ceph with an aes256k key (ceph fs authorize --key-type=aes256k) succeeds - msgr1 (legacy, mon port 6789) and msgr2 both verified - read/write (64 MiB file, checksummed), 250-char file names, nested directories; dmesg clean, no warnings Please apply to 6.12/sisyphus (and to p11 after testing). /tmp/cl612v2/0000-cover-letter.patch /tmp/cl612v2/0001-crypto-krb5-Add-some-constants-out-of-sunrpc-headers.patch /tmp/cl612v2/0002-crypto-krb5-Implement-Kerberos-crypto-core.patch /tmp/cl612v2/0003-crypto-krb5-Add-an-API-to-query-the-layout-of-the-cr.patch /tmp/cl612v2/0004-crypto-krb5-Add-an-API-to-alloc-and-prepare-a-crypto.patch /tmp/cl612v2/0005-crypto-krb5-Add-an-API-to-perform-requests.patch /tmp/cl612v2/0006-crypto-krb5-Provide-infrastructure-and-key-derivatio.patch /tmp/cl612v2/0007-crypto-krb5-Implement-the-Kerberos5-rfc3961-key-deri.patch /tmp/cl612v2/0008-crypto-krb5-Provide-RFC3961-setkey-packaging-functio.patch /tmp/cl612v2/0009-crypto-krb5-Implement-the-Kerberos5-rfc3961-encrypt-.patch /tmp/cl612v2/0010-crypto-krb5-Implement-the-Kerberos5-rfc3961-get_mic-.patch /tmp/cl612v2/0011-crypto-krb5-Implement-the-AES-enctypes-from-rfc3962.patch /tmp/cl612v2/0012-crypto-krb5-Implement-the-AES-enctypes-from-rfc8009.patch /tmp/cl612v2/0013-crypto-krb5-Implement-the-Camellia-enctypes-from-rfc.patch /tmp/cl612v2/0014-crypto-krb5-Implement-crypto-self-testing.patch /tmp/cl612v2/0015-lib-scatterlist-Add-SG_MITER_LOCAL-and-use-it.patch /tmp/cl612v2/0016-crypto-krb5-Use-SG-miter-instead-of-doing-it-by-hand.patch /tmp/cl612v2/0017-crypto-krb5-Fix-change-to-use-SG-miter-to-use-offset.patch /tmp/cl612v2/0018-crypto-krb5-Fix-memory-leak-in-krb5_test_one_prf.patch /tmp/cl612v2/0019-crypto-krb5-Add-API-Documentation.patch /tmp/cl612v2/0020-crypto-krb5-rxrpc-Fix-lack-of-pre-decrypt-pre-verify.patch /tmp/cl612v2/0021-crypto-krb5-filter-out-async-aead-implementations-at.patch /tmp/cl612v2/0022-crypto-krb5-use-kfree_sensitive-for-derived-key-buff.patch /tmp/cl612v2/0023-libceph-Rename-hmac_sha256-to-ceph_hmac_sha256.patch /tmp/cl612v2/0024-libceph-generalize-ceph_x_encrypt_offset-and-ceph_x_.patch /tmp/cl612v2/0025-libceph-Remove-unused-ceph_crypto_key_encode.patch /tmp/cl612v2/0026-libceph-introduce-ceph_crypto_key_prepare.patch /tmp/cl612v2/0027-libceph-add-support-for-CEPH_CRYPTO_AES256KRB5.patch /tmp/cl612v2/0028-libceph-adapt-ceph_x_challenge_blob-hashing-and-msgr.patch /tmp/cl612v2/0029-config-enable-CONFIG_CRYPTO_KRB5.patch Alexey Shabalin (1): config: enable CONFIG_CRYPTO_KRB5 David Howells (17): crypto/krb5: Add some constants out of sunrpc headers crypto/krb5: Implement Kerberos crypto core crypto/krb5: Add an API to query the layout of the crypto section crypto/krb5: Add an API to alloc and prepare a crypto object crypto/krb5: Add an API to perform requests crypto/krb5: Provide infrastructure and key derivation crypto/krb5: Implement the Kerberos5 rfc3961 key derivation crypto/krb5: Provide RFC3961 setkey packaging functions crypto/krb5: Implement the Kerberos5 rfc3961 encrypt and decrypt functions crypto/krb5: Implement the Kerberos5 rfc3961 get_mic and verify_mic crypto/krb5: Implement the AES enctypes from rfc3962 crypto/krb5: Implement the AES enctypes from rfc8009 crypto/krb5: Implement the Camellia enctypes from rfc6803 crypto/krb5: Implement crypto self-testing crypto/krb5: Fix change to use SG miter to use offset crypto/krb5: Add API Documentation crypto/krb5, rxrpc: Fix lack of pre-decrypt/pre-verify length checks Dr. David Alan Gilbert (1): libceph: Remove unused ceph_crypto_key_encode Eric Biggers (2): crypto: krb5 - Fix memory leak in krb5_test_one_prf() libceph: Rename hmac_sha256() to ceph_hmac_sha256() Herbert Xu (2): lib/scatterlist: Add SG_MITER_LOCAL and use it crypto: krb5 - Use SG miter instead of doing it by hand Ilya Dryomov (4): libceph: generalize ceph_x_encrypt_offset() and ceph_x_encrypt_buflen() libceph: introduce ceph_crypto_key_prepare() libceph: add support for CEPH_CRYPTO_AES256KRB5 libceph: adapt ceph_x_challenge_blob hashing and msgr1 message signing Jan Sebastian Götte (1): crypto: krb5 - use kfree_sensitive() for derived key buffers Michael Bommarito (1): crypto: krb5 - filter out async aead implementations at alloc Documentation/crypto/index.rst | 1 + Documentation/crypto/krb5.rst | 271 +++++++++++ config | 6 + crypto/Kconfig | 1 + crypto/Makefile | 2 + crypto/krb5/Kconfig | 26 + crypto/krb5/Makefile | 18 + crypto/krb5/internal.h | 247 ++++++++++ crypto/krb5/krb5_api.c | 494 +++++++++++++++++++ crypto/krb5/krb5_kdf.c | 145 ++++++ crypto/krb5/rfc3961_simplified.c | 793 +++++++++++++++++++++++++++++++ crypto/krb5/rfc3962_aes.c | 115 +++++ crypto/krb5/rfc6803_camellia.c | 237 +++++++++ crypto/krb5/rfc8009_aes2.c | 362 ++++++++++++++ crypto/krb5/selftest.c | 545 +++++++++++++++++++++ crypto/krb5/selftest_data.c | 291 ++++++++++++ include/crypto/krb5.h | 163 +++++++ include/linux/ceph/ceph_fs.h | 5 +- include/linux/scatterlist.h | 1 + lib/scatterlist.c | 12 +- net/ceph/Kconfig | 1 + net/ceph/auth_x.c | 200 +++++--- net/ceph/auth_x_protocol.h | 38 ++ net/ceph/crypto.c | 300 +++++++++--- net/ceph/crypto.h | 22 +- net/ceph/messenger_v2.c | 12 +- 26 files changed, 4180 insertions(+), 128 deletions(-) create mode 100644 Documentation/crypto/krb5.rst create mode 100644 crypto/krb5/Kconfig create mode 100644 crypto/krb5/Makefile create mode 100644 crypto/krb5/internal.h create mode 100644 crypto/krb5/krb5_api.c create mode 100644 crypto/krb5/krb5_kdf.c create mode 100644 crypto/krb5/rfc3961_simplified.c create mode 100644 crypto/krb5/rfc3962_aes.c create mode 100644 crypto/krb5/rfc6803_camellia.c create mode 100644 crypto/krb5/rfc8009_aes2.c create mode 100644 crypto/krb5/selftest.c create mode 100644 crypto/krb5/selftest_data.c create mode 100644 include/crypto/krb5.h -- 2.50.1