From mboxrd@z Thu Jan 1 00:00:00 1970 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 CB2DA1AAE04 for ; Thu, 20 Jun 2024 11:17:20 +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=1718882240; cv=none; b=JMn+6H5Xa5CoJW6wes0BcxGs7Xytun/XOhIEhUug7FJCRtn+ksuP3VwUUWJfyJBfbslDfoNzvvlcYwxFABrzJ57l4tEuoqexqw+LgO687SMp9vhQKfyH3UMCMl3xSeKDLHwIvW/rrzaoYOGhtuwXU1XSUWOEHSS1w80uv9/2nO4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718882240; c=relaxed/simple; bh=DE+MuWld4XCvFXbqnOOg4te/HG757M3fGhd3fotyH2E=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=m4TLRp9K2xi3AITV9qO9trGeTS3iZvO3O1ZP/n0dPRue3c7fQbj9kgD+Gs2+NXhqYN4KqbRZvEbr/dLrTjTfl4XXXxVFWiH+3grhoBhtfsoyYz+6/qw87gquRUADpOSwBGHCT3dGpt24/6K/yeDtkEmVEgZbCUnW6JoQe/NQ5qc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XC92B3al; 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="XC92B3al" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81B06C2BD10; Thu, 20 Jun 2024 11:17:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718882239; bh=DE+MuWld4XCvFXbqnOOg4te/HG757M3fGhd3fotyH2E=; h=From:To:Cc:Subject:Date:Reply-to:From; b=XC92B3alxcoIbCh/30GWlQY0MFs1+cA7KjVGDzqSaN9hZCwQqE4hOiA8rk6YYNwQ0 r9lPJhavlw0OPj4bPbhM0qLhBIuVjduDVioK/5VrLS4xF+9wkz1mY2P70LM4rHm+BC 7zO5f52MNNb2tFrlNUzu+BC97nTfK+cF8COiy35Q= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-48740: selinux: fix double free of cond_list on error paths Date: Thu, 20 Jun 2024 13:16:20 +0200 Message-ID: <2024062002-CVE-2022-48740-a623@gregkh> X-Mailer: git-send-email 2.45.2 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=2184; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=DE+MuWld4XCvFXbqnOOg4te/HG757M3fGhd3fotyH2E=; b=owGbwMvMwCRo6H6F97bub03G02pJDGkl/EWxmze1Xzm01F8lNmKeFqvB196soI13ywv5Dy+qF PlwrmpRRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEykT5hhfsW11GnP9hx/dCD/ iHGxzb5cvbnzbjLMs9PqS7XU5Q7Zbv7OYeLzPf4qt4qmAAA= 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: selinux: fix double free of cond_list on error paths On error path from cond_read_list() and duplicate_policydb_cond_list() the cond_list_destroy() gets called a second time in caller functions, resulting in NULL pointer deref. Fix this by resetting the cond_list_len to 0 in cond_list_destroy(), making subsequent calls a noop. Also consistently reset the cond_list pointer to NULL after freeing. [PM: fix line lengths in the description] The Linux kernel CVE team has assigned CVE-2022-48740 to this issue. Affected and fixed versions =========================== Fixed in 5.10.99 with commit f446089a268c Fixed in 5.15.22 with commit 70caa32e6d81 Fixed in 5.16.8 with commit 7ed9cbf7ac0d Fixed in 5.17 with commit 186edf7e368c 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-48740 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: security/selinux/ss/conditional.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/f446089a268c8fc6908488e991d28a9b936293db https://git.kernel.org/stable/c/70caa32e6d81f45f0702070c0e4dfe945e92fbd7 https://git.kernel.org/stable/c/7ed9cbf7ac0d4ed86b356e1b944304ae9ee450d4 https://git.kernel.org/stable/c/186edf7e368c40d06cf727a1ad14698ea67b74ad