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 E11BA2C1AC for ; Wed, 28 Feb 2024 08:18:16 +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=1709108297; cv=none; b=Qb4h7JhH1k1m0r03JSPvCY4bxLhJNvuHgM74Qaj44Bf1eq220RVep/vm964a59mCB3lnR/c1xxsl97/r7dFcH6ST5jA6NzprY5qKV25yJ77XkXbIBCzKgAvrM2TTsdx0E8CaKMDn9BAMqsFCPkumBzrvOPD/LU5TaALwda9yBKA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709108297; c=relaxed/simple; bh=G71Ox5hvjEVEZj3HzOUb/PSiRTRyI1/6HrWbzuM+WbY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=XZguJfO086eZRISmpNz4aZ2fs/0AoMCHEWwRiNsAb/IVIg9FTUme3g8InAJJkvvSNBnZij+bpqzZbLjU22hl+jfVAafnMPAE1D0IEW3aoht71Bfxga3NcNIyiH3+nyRen9E09/4TZkfHTj/MKm8pvSASMMUOpM5b8gGDnyK5jf8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=sm7XHSXN; 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="sm7XHSXN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F8C9C433C7; Wed, 28 Feb 2024 08:18:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1709108296; bh=G71Ox5hvjEVEZj3HzOUb/PSiRTRyI1/6HrWbzuM+WbY=; h=From:To:Cc:Subject:Date:Reply-to:From; b=sm7XHSXNoeip52iV7lzlfx+bnH5i+/AG4bD3CRyz1rZNKEXvqQoGsQFI14EPDStoA rwmUvo5yfaSDUFhldgvZfwSS/VqkLs04ByuOteFTfG3ruRTqWYIm0Jeb2utXEp1nne eaEkKnOwbK1G8SyMJ5ll54/UsesRa3+te3/Yqxng= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: gregkh@kernel.org Subject: CVE-2021-47014: net/sched: act_ct: fix wild memory access when clearing fragments Date: Wed, 28 Feb 2024 09:15:04 +0100 Message-ID: <2024022831-CVE-2021-47014-ffc7@gregkh> X-Mailer: git-send-email 2.44.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=3480; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=VciFQDyXpiQPW0D2D5yjjC4k7vuqJbPCZOu2hFgEQdk=; b=owGbwMvMwCRo6H6F97bub03G02pJDKn3Xme4qa+f6HjadpO+eIHhG4WWtk+3uGoSn1fcSKtdK vHx4na7jlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZhI+UqG+eEL2JUV2j5eTp3M 8m//L8uO8olTMxjmWXDU/Ody+/s1j5N1+VLJ++le+1Z9AAA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: gregkh@kernel.org Description =========== In the Linux kernel, the following vulnerability has been resolved: net/sched: act_ct: fix wild memory access when clearing fragments while testing re-assembly/re-fragmentation using act_ct, it's possible to observe a crash like the following one: KASAN: maybe wild-memory-access in range [0x0001000000000448-0x000100000000044f] CPU: 50 PID: 0 Comm: swapper/50 Tainted: G S 5.12.0-rc7+ #424 Hardware name: Dell Inc. PowerEdge R730/072T6D, BIOS 2.4.3 01/17/2017 RIP: 0010:inet_frag_rbtree_purge+0x50/0xc0 Code: 00 fc ff df 48 89 c3 31 ed 48 89 df e8 a9 7a 38 ff 4c 89 fe 48 89 df 49 89 c6 e8 5b 3a 38 ff 48 8d 7b 40 48 89 f8 48 c1 e8 03 <42> 80 3c 20 00 75 59 48 8d bb d0 00 00 00 4c 8b 6b 40 48 89 f8 48 RSP: 0018:ffff888c31449db8 EFLAGS: 00010203 RAX: 0000200000000089 RBX: 000100000000040e RCX: ffffffff989eb960 RDX: 0000000000000140 RSI: ffffffff97cfb977 RDI: 000100000000044e RBP: 0000000000000900 R08: 0000000000000000 R09: ffffed1186289350 R10: 0000000000000003 R11: ffffed1186289350 R12: dffffc0000000000 R13: 000100000000040e R14: 0000000000000000 R15: ffff888155e02160 FS: 0000000000000000(0000) GS:ffff888c31440000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005600cb70a5b8 CR3: 0000000a2c014005 CR4: 00000000003706e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: inet_frag_destroy+0xa9/0x150 call_timer_fn+0x2d/0x180 run_timer_softirq+0x4fe/0xe70 __do_softirq+0x197/0x5a0 irq_exit_rcu+0x1de/0x200 sysvec_apic_timer_interrupt+0x6b/0x80 when act_ct temporarily stores an IP fragment, restoring the skb qdisc cb results in putting random data in FRAG_CB(), and this causes those "wild" memory accesses later, when the rbtree is purged. Never overwrite the skb cb in case tcf_ct_handle_fragments() returns -EINPROGRESS. The Linux kernel CVE team has assigned CVE-2021-47014 to this issue. Affected and fixed versions =========================== Issue introduced in 5.8 with commit 7baf2429a1a9 and fixed in 5.12.4 with commit 0648941f4c8b Issue introduced in 5.8 with commit 7baf2429a1a9 and fixed in 5.13 with commit f77bd544a6bb Please see https://www.kernel.org or 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-2021-47014 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/sched/act_ct.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/0648941f4c8bbf8b4b6c0b270889ae7aa769b921 https://git.kernel.org/stable/c/f77bd544a6bbe69aa50d9ed09f13494cf36ff806