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 72CA7273D6F for ; Wed, 1 Oct 2025 07:47:34 +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=1759304854; cv=none; b=ek3qByB9XpffvrscuMXUVvW24DCL0Hi4zQZP1fTYu8XQAIz4Pj+XLsP2LbJVpHZzdZmZM0lcUhQ5sy1GlfqZG4kmM6kmu5UZ0fxH6XDUUaS+gZ3kE+cBQdy+z/pzxI1HMqHIwPcny88RwouGMxAmmEkkpG9jBAlyWQ3L5i9GyNo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759304854; c=relaxed/simple; bh=7f00SFwgIwPMcAOWrxEObuFLLV8qDy5d28qYtUJ/ILw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=cdNdJUMjk34jetb82auWdKr3XFuIGT82NpzFzTe8Gip9fCYEEORITwbPXT9AxVXl/ieE/flG8rl1vuahs1IZkLbA+/ob/0oXByRQ/1K4fPOeHbU3/qH5ay03blV7C5xLu/SVX6faXMQ8ZX4bkEZfTZsdLFOCBBA7OGydYkhJbCo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ERqSD1lo; 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="ERqSD1lo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED03AC4CEF7; Wed, 1 Oct 2025 07:47:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759304854; bh=7f00SFwgIwPMcAOWrxEObuFLLV8qDy5d28qYtUJ/ILw=; h=From:To:Cc:Subject:Date:Reply-to:From; b=ERqSD1lo8Osj0PHaZEaJpQyFCymdbOLHrGu5SLuOKfyaAqNydvRIwIfQO1JpcuJ92 0z4MwullknK07Vf67dHmj1NJcVYiGC6bUvf0vH0d3lly/jxf5nSwAsVnc4ArqNxuti FYi7OFo7T1rlJ76J0HSQKNGTRvgZLFNNqeiF15Cw= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-39917: bpf: Fix out-of-bounds dynptr write in bpf_crypto_crypt Date: Wed, 1 Oct 2025 09:47:22 +0200 Message-ID: <2025100112-CVE-2025-39917-b3a9@gregkh> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=2878; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=ynzZhIzIb04jYR1vKkFwNUvvLqamvpNgfXGCZ980hoI=; b=owGbwMvMwCRo6H6F97bub03G02pJDBl37jSkWa0ri1Z48mzO5DCb2y5NAlMOVMfP9kyNqpiex 77l1A7/jlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjI308M892jc96ILPFaZ+d/ imHDHjGD5bJ2lgwLOoRm+m245FxwOCH7nkVj6K7mzcIlAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: bpf: Fix out-of-bounds dynptr write in bpf_crypto_crypt Stanislav reported that in bpf_crypto_crypt() the destination dynptr's size is not validated to be at least as large as the source dynptr's size before calling into the crypto backend with 'len = src_len'. This can result in an OOB write when the destination is smaller than the source. Concretely, in mentioned function, psrc and pdst are both linear buffers fetched from each dynptr: psrc = __bpf_dynptr_data(src, src_len); [...] pdst = __bpf_dynptr_data_rw(dst, dst_len); [...] err = decrypt ? ctx->type->decrypt(ctx->tfm, psrc, pdst, src_len, piv) : ctx->type->encrypt(ctx->tfm, psrc, pdst, src_len, piv); The crypto backend expects pdst to be large enough with a src_len length that can be written. Add an additional src_len > dst_len check and bail out if it's the case. Note that these kfuncs are accessible under root privileges only. The Linux kernel CVE team has assigned CVE-2025-39917 to this issue. Affected and fixed versions =========================== Issue introduced in 6.10 with commit 3e1c6f35409f9e447bf37f64840f5b65576bfb78 and fixed in 6.12.48 with commit 0126358df12d6f476f79251d9c398ac5c1b3062d Issue introduced in 6.10 with commit 3e1c6f35409f9e447bf37f64840f5b65576bfb78 and fixed in 6.16.8 with commit c4be24ef0510c146dca4671effb127e97631534b Issue introduced in 6.10 with commit 3e1c6f35409f9e447bf37f64840f5b65576bfb78 and fixed in 6.17 with commit f9bb6ffa7f5ad0f8ee0f53fc4a10655872ee4a14 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2025-39917 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: kernel/bpf/crypto.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/0126358df12d6f476f79251d9c398ac5c1b3062d https://git.kernel.org/stable/c/c4be24ef0510c146dca4671effb127e97631534b https://git.kernel.org/stable/c/f9bb6ffa7f5ad0f8ee0f53fc4a10655872ee4a14