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 339CF1A5BA2 for ; Wed, 26 Feb 2025 01:58:10 +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=1740535090; cv=none; b=nhkeAbeEiUaeNajCPzg3NFcNO2A7XYKbPExMMsCgtyQUN2QDDwZYSAWQkHZSwP/6t58CEx5RxbLhlEzwPThH5Pq6up48ofVPprn2jrxzcW75JQ3Kzsy9ICnu0YDArjXIrvjJJLv4h9Y8oq/pLFygsRnxUJsm8IBAy17UQihzsIk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740535090; c=relaxed/simple; bh=Zvjh8vUDz+WNrZaSRELAyudnvyo9zwIhVaRAn1OmXOQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=qgaJDlIeI8gV80Yv++pl9BC7nLb6ceRbpQUdcFvt3pYEN/LmnhgSNY8/PtROneXdsdBvvdLFcMFRoqr1paqifM3gSgacuuKzLiQQF+NLNG9cB2SzQphTaiPaBE0bPms+PbYIei0Npe+Bfi52vDoaZiPI5+OI+aEg95LIVGnswIQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=L83ALdbf; 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="L83ALdbf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0753FC4CEDD; Wed, 26 Feb 2025 01:58:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740535090; bh=Zvjh8vUDz+WNrZaSRELAyudnvyo9zwIhVaRAn1OmXOQ=; h=From:To:Cc:Subject:Date:Reply-to:From; b=L83ALdbfzfysPf+b69cyHRWaI71tzA8mlckDAC/Z4bqdtJjcOPrB8haaSJ+O7IMCl bhQVHciJjRqyfULgPP355RMJwC0ou9iAm5v7yoXYDt5yNLztyJTJON5bl988K9yvZv 7jGO6MYDE0Rn7ZY1tYIP5v5dbPQxRDeQUAs2pCAI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49094: net/tls: fix slab-out-of-bounds bug in decrypt_internal Date: Wed, 26 Feb 2025 02:54:59 +0100 Message-ID: <2025022659-CVE-2022-49094-9749@gregkh> X-Mailer: git-send-email 2.48.1 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=3912; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Zvjh8vUDz+WNrZaSRELAyudnvyo9zwIhVaRAn1OmXOQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7SswPV/5KWVc32eOY/s20jxvTiy4996zNVW5y1n10/ nVl8P13HbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRd20M8wzXS7E1JfmkHevb 7Tm37FCiR7tVO8P8yoR8XvEUR8EjpdMC/r3IPrA9tusfAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: net/tls: fix slab-out-of-bounds bug in decrypt_internal The memory size of tls_ctx->rx.iv for AES128-CCM is 12 setting in tls_set_sw_offload(). The return value of crypto_aead_ivsize() for "ccm(aes)" is 16. So memcpy() require 16 bytes from 12 bytes memory space will trigger slab-out-of-bounds bug as following: ================================================================== BUG: KASAN: slab-out-of-bounds in decrypt_internal+0x385/0xc40 [tls] Read of size 16 at addr ffff888114e84e60 by task tls/10911 Call Trace: dump_stack_lvl+0x34/0x44 print_report.cold+0x5e/0x5db ? decrypt_internal+0x385/0xc40 [tls] kasan_report+0xab/0x120 ? decrypt_internal+0x385/0xc40 [tls] kasan_check_range+0xf9/0x1e0 memcpy+0x20/0x60 decrypt_internal+0x385/0xc40 [tls] ? tls_get_rec+0x2e0/0x2e0 [tls] ? process_rx_list+0x1a5/0x420 [tls] ? tls_setup_from_iter.constprop.0+0x2e0/0x2e0 [tls] decrypt_skb_update+0x9d/0x400 [tls] tls_sw_recvmsg+0x3c8/0xb50 [tls] Allocated by task 10911: kasan_save_stack+0x1e/0x40 __kasan_kmalloc+0x81/0xa0 tls_set_sw_offload+0x2eb/0xa20 [tls] tls_setsockopt+0x68c/0x700 [tls] __sys_setsockopt+0xfe/0x1b0 Replace the crypto_aead_ivsize() with prot->iv_size + prot->salt_size when memcpy() iv value in TLS_1_3_VERSION scenario. The Linux kernel CVE team has assigned CVE-2022-49094 to this issue. Affected and fixed versions =========================== Issue introduced in 5.2 with commit f295b3ae9f5927e084bd5decdff82390e3471801 and fixed in 5.4.189 with commit 2b7d14c105dd8f6412eda5a91e1e6154653731e3 Issue introduced in 5.2 with commit f295b3ae9f5927e084bd5decdff82390e3471801 and fixed in 5.10.111 with commit 589154d0f18945f41d138a5b4e49e518d294474b Issue introduced in 5.2 with commit f295b3ae9f5927e084bd5decdff82390e3471801 and fixed in 5.15.34 with commit 6e2f1b033b17dedda51d465861b69e58317d6343 Issue introduced in 5.2 with commit f295b3ae9f5927e084bd5decdff82390e3471801 and fixed in 5.16.20 with commit 29be1816cbab9a0dc6243120939fd10a92753756 Issue introduced in 5.2 with commit f295b3ae9f5927e084bd5decdff82390e3471801 and fixed in 5.17.3 with commit 2304660ab6c425df64d95301b601424c6a50f28b Issue introduced in 5.2 with commit f295b3ae9f5927e084bd5decdff82390e3471801 and fixed in 5.18 with commit 9381fe8c849cfbe50245ac01fc077554f6eaa0e2 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-2022-49094 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: net/tls/tls_sw.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/2b7d14c105dd8f6412eda5a91e1e6154653731e3 https://git.kernel.org/stable/c/589154d0f18945f41d138a5b4e49e518d294474b https://git.kernel.org/stable/c/6e2f1b033b17dedda51d465861b69e58317d6343 https://git.kernel.org/stable/c/29be1816cbab9a0dc6243120939fd10a92753756 https://git.kernel.org/stable/c/2304660ab6c425df64d95301b601424c6a50f28b https://git.kernel.org/stable/c/9381fe8c849cfbe50245ac01fc077554f6eaa0e2