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 959921F37BA for ; Fri, 27 Dec 2024 14:23:42 +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=1735309422; cv=none; b=lAoaEAcPbWjDIMBx0DUQvkJOr3WVNwpDFrwE7RDGIe3MNWdhQBtXiNqEef8vPfUwLB9JHbCxiF9o861vCmkwgMH7M8V+96r2DIMwSLpa4SVT9d2eN6/PvvTgPMhAMUohTHajaD/atrcwadhGqw9kCZn9f47bgb5NmvsawoodzUM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735309422; c=relaxed/simple; bh=gsdZAPzCnqnvlN134fg97TY5WH0fvRQrGAIulPr5gjg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=gY7zMGPh5LQUb18lAofLXkd5Cga9Dkqi2wZWI6BqZWT8xudSKVm9XUySEGNKCNcxN39R7/VGqyOAO/+whxKBS4sJvmiSlGsmSrzpyqisaKju/VXQCmOLC/DVjQ86v3NS2UhCq+QZXLl6pOrhGbbh3emVK4s/5ycceG9xkEuW8HI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ljGhQDby; 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="ljGhQDby" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 832CFC4CED0; Fri, 27 Dec 2024 14:23:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1735309422; bh=gsdZAPzCnqnvlN134fg97TY5WH0fvRQrGAIulPr5gjg=; h=From:To:Cc:Subject:Date:Reply-to:From; b=ljGhQDbyOvRjzDtqx1QgHCMGtOWWrrtqYeT4Xop1yJHi4E/EHJSnOwrpy1Th3JcVU OHmYz4F2JmOxsLaLxahqQkXZfUmaGxdcyDyaNkOUMYOZYNgaJTzni+6ACR9gdNclw5 3m7ylK/ll3fVm9VmOE0uLTp8rcUkDAL7WMXDM1gs= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-56553: binder: fix memleak of proc->delivered_freeze Date: Fri, 27 Dec 2024 15:23:04 +0100 Message-ID: <2024122710-CVE-2024-56553-e097@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=3181; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=gsdZAPzCnqnvlN134fg97TY5WH0fvRQrGAIulPr5gjg=; b=owGbwMvMwCRo6H6F97bub03G02pJDOl5O/wUnI87BW5f4S8geWOmqN+Erct/lp8+LaLcGVzQF xVU0bS4I5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACaiso9hntrVpL9NWhccgiZX H2zREmNf7HahgWF+aUlTS97crSlbpt7gU91a+bls0fY3AA== 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 memleak of proc->delivered_freeze If a freeze notification is cleared with BC_CLEAR_FREEZE_NOTIFICATION before calling binder_freeze_notification_done(), then it is detached from its reference (e.g. ref->freeze) but the work remains queued in proc->delivered_freeze. This leads to a memory leak when the process exits as any pending entries in proc->delivered_freeze are not freed: unreferenced object 0xffff38e8cfa36180 (size 64): comm "binder-util", pid 655, jiffies 4294936641 hex dump (first 32 bytes): b8 e9 9e c8 e8 38 ff ff b8 e9 9e c8 e8 38 ff ff .....8.......8.. 0b 00 00 00 00 00 00 00 3c 1f 4b 00 00 00 00 00 ........<.K..... backtrace (crc 95983b32): [<000000000d0582cf>] kmemleak_alloc+0x34/0x40 [<000000009c99a513>] __kmalloc_cache_noprof+0x208/0x280 [<00000000313b1704>] binder_thread_write+0xdec/0x439c [<000000000cbd33bb>] binder_ioctl+0x1b68/0x22cc [<000000002bbedeeb>] __arm64_sys_ioctl+0x124/0x190 [<00000000b439adee>] invoke_syscall+0x6c/0x254 [<00000000173558fc>] el0_svc_common.constprop.0+0xac/0x230 [<0000000084f72311>] do_el0_svc+0x40/0x58 [<000000008b872457>] el0_svc+0x38/0x78 [<00000000ee778653>] el0t_64_sync_handler+0x120/0x12c [<00000000a8ec61bf>] el0t_64_sync+0x190/0x194 This patch fixes the leak by ensuring that any pending entries in proc->delivered_freeze are freed during binder_deferred_release(). The Linux kernel CVE team has assigned CVE-2024-56553 to this issue. Affected and fixed versions =========================== Issue introduced in 6.12 with commit d579b04a52a183db47dfcb7a44304d7747d551e1 and fixed in 6.12.4 with commit b8b77712142fb146fe18d2253bc8a798d522e427 Issue introduced in 6.12 with commit d579b04a52a183db47dfcb7a44304d7747d551e1 and fixed in 6.13-rc1 with commit 1db76ec2b4b206ff943e292a0b55e68ff3443598 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-56553 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/b8b77712142fb146fe18d2253bc8a798d522e427 https://git.kernel.org/stable/c/1db76ec2b4b206ff943e292a0b55e68ff3443598