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 7BAF41F1316 for ; Fri, 27 Dec 2024 13:53:06 +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=1735307586; cv=none; b=Mazp9ZfwosgD0igou7o0YTfz3qeSTpXRge/O5Tg5Qb0/m0i9y0qmgrsAqT/k55+QEr2gJS2xA6RN9A8S6An9ZpzgEf4n12ANmZ6xeLkLIYUqoVVj1I85PoAq4eWhDnMIKenGwqnessNvyrGrTCpWPTTsI138iCjtXjV9pDnnZ+0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735307586; c=relaxed/simple; bh=sJMJ6z1RIGf0qYuGepU3TQz9q2ERTu4ABCmRpgELKcs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=dO2nljUFK/nKaQ0KJiYNgOgKtugD4GePQDdiNiV9AuWHFgbokdqT7yf6TAr9Z31tzbyj472HRXSTSovGe08sn1vjmI1D2VdoEkVeJcb7vnQuUzL8iZamQT+BS6FM02pUrr47N8pG125BhF8KJzXEGXyx+38dwYrWkt5yBnDTyHk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=QS6/oeNW; 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="QS6/oeNW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2751C4CED0; Fri, 27 Dec 2024 13:53:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1735307586; bh=sJMJ6z1RIGf0qYuGepU3TQz9q2ERTu4ABCmRpgELKcs=; h=From:To:Cc:Subject:Date:Reply-to:From; b=QS6/oeNWkbWMavCkBzubkTpnYc3V9hN4whpZXkH8c3o07Nmyi9wrbiCLVIsS6AeMh 1H2MDpq7/NmyRoaivze6IDQbhPw0DLo7tQ9FsmOlLMR+2DUN9MPMmjrAhgxrwlUtRk wkmlQjhd+9l8wrANVvzQ2Djt7xlaaHzNarJzv3LI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-53175: ipc: fix memleak if msg_init_ns failed in create_ipc_ns Date: Fri, 27 Dec 2024 14:52:21 +0100 Message-ID: <2024122717-CVE-2024-53175-6ebd@gregkh> X-Mailer: git-send-email 2.47.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=3624; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=sJMJ6z1RIGf0qYuGepU3TQz9q2ERTu4ABCmRpgELKcs=; b=owGbwMvMwCRo6H6F97bub03G02pJDOl5G4VUuI/9eR4v7vE++NnTuArTdb/XrNoZI8Jea6V28 WiQ5dL7HbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRrykM8wuzRTalnZYxOeO6 /umei1ouk0VbHjLMz/v2p86AOfZDx/xXh7RsIxJ1//q9BwA= 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: ipc: fix memleak if msg_init_ns failed in create_ipc_ns Percpu memory allocation may failed during create_ipc_ns however this fail is not handled properly since ipc sysctls and mq sysctls is not released properly. Fix this by release these two resource when failure. Here is the kmemleak stack when percpu failed: unreferenced object 0xffff88819de2a600 (size 512): comm "shmem_2nstest", pid 120711, jiffies 4300542254 hex dump (first 32 bytes): 60 aa 9d 84 ff ff ff ff fc 18 48 b2 84 88 ff ff `.........H..... 04 00 00 00 a4 01 00 00 20 e4 56 81 ff ff ff ff ........ .V..... backtrace (crc be7cba35): [] __kmalloc_node_track_caller_noprof+0x333/0x420 [] kmemdup_noprof+0x26/0x50 [] setup_mq_sysctls+0x57/0x1d0 [] copy_ipcs+0x29c/0x3b0 [] create_new_namespaces+0x1d0/0x920 [] copy_namespaces+0x2e9/0x3e0 [] copy_process+0x29f3/0x7ff0 [] kernel_clone+0xc0/0x650 [] __do_sys_clone+0xa1/0xe0 [] do_syscall_64+0xbf/0x1c0 [] entry_SYSCALL_64_after_hwframe+0x4b/0x53 The Linux kernel CVE team has assigned CVE-2024-53175 to this issue. Affected and fixed versions =========================== Issue introduced in 6.1 with commit 72d1e611082eda18689106a0c192f2827072713c and fixed in 6.1.120 with commit 3d230cfd4b9b0558c7b2039ba1def2ce6b6cd158 Issue introduced in 6.1 with commit 72d1e611082eda18689106a0c192f2827072713c and fixed in 6.6.64 with commit 10209665b5bf199f8065b2e7d2b2dc6cdf227117 Issue introduced in 6.1 with commit 72d1e611082eda18689106a0c192f2827072713c and fixed in 6.11.11 with commit 8fed302872e26c7bf44d855c53a1cde747172d58 Issue introduced in 6.1 with commit 72d1e611082eda18689106a0c192f2827072713c and fixed in 6.12.2 with commit 928de5fcd462498b8334107035da8ab85e316d8a Issue introduced in 6.1 with commit 72d1e611082eda18689106a0c192f2827072713c and fixed in 6.13-rc1 with commit bc8f5921cd69188627c08041276238de222ab466 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-2024-53175 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: ipc/namespace.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/3d230cfd4b9b0558c7b2039ba1def2ce6b6cd158 https://git.kernel.org/stable/c/10209665b5bf199f8065b2e7d2b2dc6cdf227117 https://git.kernel.org/stable/c/8fed302872e26c7bf44d855c53a1cde747172d58 https://git.kernel.org/stable/c/928de5fcd462498b8334107035da8ab85e316d8a https://git.kernel.org/stable/c/bc8f5921cd69188627c08041276238de222ab466