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 C1AAB7EEF8 for ; Tue, 21 May 2024 15:05:45 +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=1716303945; cv=none; b=PVPD+49k4Q1rxzqYc9nlu0oGHSGKc+WF0mjEN8G4fHh+XwApKXEbIa1f+e811SPVNFxNlGERfL2M6LiKZ+yh3V+ZTbxCrZ+p3r0WsuCNn+vFFohAcO7JMNKY2MrxvkTH5Hb0Xh/LXB87R4iNLrt8F6ePaGFNQRB+z9SSjBBmCTc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716303945; c=relaxed/simple; bh=aKkZW0/82/osWWXk/CkxhMFQIZD+XKf2wC5F5OSbAJo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ucTfE5doKLV7NTBmCUdq4HsWuLvggGTIgKjGTJ2ThCCQ/y9hEOi/UlmRp3zsEYVVVto2Mlq/AdbI3DPBVowMIt0BDnLGBoMaCCW9U3kJkrur/RuBBdScE8j3xBrHm6pntFXhBxBtJ7jhQM6rnmlq9sLXZ4Dnw1+wr4EfMghcVSo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=wna8rJBj; 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="wna8rJBj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A141C2BD11; Tue, 21 May 2024 15:05:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716303945; bh=aKkZW0/82/osWWXk/CkxhMFQIZD+XKf2wC5F5OSbAJo=; h=From:To:Cc:Subject:Date:Reply-to:From; b=wna8rJBjg/398J+dC6e3Z2hK41/ppbY0NcTtYWPkqn7AP8Fg85kv5ifhaiUoGVlRG t6qb+e6dOWqNBzd4/Lf6DMLjEnlKBG/ePljcRSk2VmIMsmlGh7PWEP7yt0gzuCJLs8 EJmZNKidYU3Jed2mq+pknwsuxT4obkyoVFDdgOm8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47394: netfilter: nf_tables: unlink table before deleting it Date: Tue, 21 May 2024 17:04:11 +0200 Message-ID: <2024052147-CVE-2021-47394-9ec5@gregkh> X-Mailer: git-send-email 2.45.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=2433; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=aKkZW0/82/osWWXk/CkxhMFQIZD+XKf2wC5F5OSbAJo=; b=owGbwMvMwCRo6H6F97bub03G02pJDGk+2y/LVwezLThZGlAx7fW2BOuvmz8EHP21t3SXVcmzd b+7b0ZHdcSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBE2CQZFsxucDLbEHslPFMp 2qNJ9Nx3eZajCQzzrD9UG+vH6HYtkGyXuXd6v982th4xAA== 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: netfilter: nf_tables: unlink table before deleting it syzbot reports following UAF: BUG: KASAN: use-after-free in memcmp+0x18f/0x1c0 lib/string.c:955 nla_strcmp+0xf2/0x130 lib/nlattr.c:836 nft_table_lookup.part.0+0x1a2/0x460 net/netfilter/nf_tables_api.c:570 nft_table_lookup net/netfilter/nf_tables_api.c:4064 [inline] nf_tables_getset+0x1b3/0x860 net/netfilter/nf_tables_api.c:4064 nfnetlink_rcv_msg+0x659/0x13f0 net/netfilter/nfnetlink.c:285 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2504 Problem is that all get operations are lockless, so the commit_mutex held by nft_rcv_nl_event() isn't enough to stop a parallel GET request from doing read-accesses to the table object even after synchronize_rcu(). To avoid this, unlink the table first and store the table objects in on-stack scratch space. The Linux kernel CVE team has assigned CVE-2021-47394 to this issue. Affected and fixed versions =========================== Issue introduced in 5.12 with commit 6001a930ce03 and fixed in 5.14.10 with commit f65c73d3aabb Issue introduced in 5.12 with commit 6001a930ce03 and fixed in 5.15 with commit a499b03bf36b 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-2021-47394 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/netfilter/nf_tables_api.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/f65c73d3aabb87d4353e0bc4a718b5ae8c43fd04 https://git.kernel.org/stable/c/a499b03bf36b0c2e3b958a381d828678ab0ffc5e