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 338AA1F2375 for ; Fri, 27 Dec 2024 14:23: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=1735309426; cv=none; b=AOE/SFG6MeXX6T8oVlo5jnsXH8GVeIGHhStnYeQDtE8vlMZpJblSV4P7adx392MTXAHC7YfTqTWuDCBHMOaN2vrlRa2LsEg6dkKYP6YYOFbDSk3jQVMcZNUi4LrT7mMoM7v/BQ1v/doY8xC3Vo9dmd9q7+Jkr4DRzBg0V+G4Sjc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735309426; c=relaxed/simple; bh=lkKPCXWv4y3TVeC9x9DRcRAjzJpH44oyZB+qHjUJL3c=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ci0h82Q2XtPPozOb+GVJGWj02nQkfRhJwkZZ7eV/9NdFl3FPdqOsJNDjnxIncE1X7xt3OJriEmxwqUWiszdXq+55J8WqbPtX9Rw/7CzAXDarhIGN5pWKIK2NFau+nIKFaEKQnA3zfTOHI6ZZlINda2ree32NgoZm9Epde0qesmA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=sSb/CR8S; 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="sSb/CR8S" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35D07C4CED3; Fri, 27 Dec 2024 14:23:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1735309425; bh=lkKPCXWv4y3TVeC9x9DRcRAjzJpH44oyZB+qHjUJL3c=; h=From:To:Cc:Subject:Date:Reply-to:From; b=sSb/CR8SCDpzRnSRR4Qrpaq1qZzFtPeDoSjXAK9xRuW1B7HXmwlJuv9QW3s1QDWOz z2HGFQATNiLq3NK4MI3Np6PzbGTG2r8fNGhSk3WB9Mbsqp9BJmNmPZRfGME84J9w/R C4VWi2d/StlfhuFrxRwAxJ/xrg0LsUyz7KKkc1js= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-56554: binder: fix freeze UAF in binder_release_work() Date: Fri, 27 Dec 2024 15:23:05 +0100 Message-ID: <2024122710-CVE-2024-56554-9ee7@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=3104; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=lkKPCXWv4y3TVeC9x9DRcRAjzJpH44oyZB+qHjUJL3c=; b=owGbwMvMwCRo6H6F97bub03G02pJDOl5O/yeyc26rO744yrv/8mn1Jwe2Ekwvu26E3RqYd7dN T3Jf7PfdcSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEPI4xzBWxOBQpH7s/MSbq hbaPWpO6od6pPwzzQx4d2llfsW95x8JKn4mvV1wQ1Vx/DgA= 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: binder: fix freeze UAF in binder_release_work() When a binder reference is cleaned up, any freeze work queued in the associated process should also be removed. Otherwise, the reference is freed while its ref->freeze.work is still queued in proc->work leading to a use-after-free issue as shown by the following KASAN report: ================================================================== BUG: KASAN: slab-use-after-free in binder_release_work+0x398/0x3d0 Read of size 8 at addr ffff31600ee91488 by task kworker/5:1/211 CPU: 5 UID: 0 PID: 211 Comm: kworker/5:1 Not tainted 6.11.0-rc7-00382-gfc6c92196396 #22 Hardware name: linux,dummy-virt (DT) Workqueue: events binder_deferred_func Call trace: binder_release_work+0x398/0x3d0 binder_deferred_func+0xb60/0x109c process_one_work+0x51c/0xbd4 worker_thread+0x608/0xee8 Allocated by task 703: __kmalloc_cache_noprof+0x130/0x280 binder_thread_write+0xdb4/0x42a0 binder_ioctl+0x18f0/0x25ac __arm64_sys_ioctl+0x124/0x190 invoke_syscall+0x6c/0x254 Freed by task 211: kfree+0xc4/0x230 binder_deferred_func+0xae8/0x109c process_one_work+0x51c/0xbd4 worker_thread+0x608/0xee8 ================================================================== This commit fixes the issue by ensuring any queued freeze work is removed when cleaning up a binder reference. The Linux kernel CVE team has assigned CVE-2024-56554 to this issue. Affected and fixed versions =========================== Issue introduced in 6.12 with commit d579b04a52a183db47dfcb7a44304d7747d551e1 and fixed in 6.12.4 with commit fe39e0ea2d0ba7f508ff453c4c9a44a95ec0de29 Issue introduced in 6.12 with commit d579b04a52a183db47dfcb7a44304d7747d551e1 and fixed in 6.13-rc1 with commit 7e20434cbca814cb91a0a261ca0106815ef48e5f 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-56554 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: drivers/android/binder.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/fe39e0ea2d0ba7f508ff453c4c9a44a95ec0de29 https://git.kernel.org/stable/c/7e20434cbca814cb91a0a261ca0106815ef48e5f