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 9830328C5C6 for ; Wed, 18 Jun 2025 11:11:35 +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=1750245095; cv=none; b=UYniGkcNb9WtixlHgtPp+TxYezglz+GDG82R9BzVjwaYoaAOCmIvUs4UtrLnvtZw8yztEDUl7D1cdw+5ByvfClEKqWkrQ6SN17aSP0T989BW/IVhURVNrx1nfOqfrlGYEq1MSGWfLyKhPE0A6ndHSNVfBZyVMw5n5P4A/FIhohc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750245095; c=relaxed/simple; bh=RETSE4h22b23gfcCpzMQFtmtjdwsWVmNsIfsejkUgU4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=KwvdT30Intv98Xx6yIwBz/La5XyC24gu5ffexHwI3oV0uxPnIutFA9+P7pDssIbCweWKth9vV9Kt3be5b/3aSr9J7Ug1XU+58XgBNd/m5IA2cNbvoPVb0ckO5rMC2ekTvm2+bVv1LEy7M7e6wT0z4KwE9rGvmhZ5pYF/mdMwS50= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=BCjm949z; 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="BCjm949z" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 077D5C4CEE7; Wed, 18 Jun 2025 11:11:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750245095; bh=RETSE4h22b23gfcCpzMQFtmtjdwsWVmNsIfsejkUgU4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=BCjm949zxqUJZP+QLVpZj4Su+O4Zqe4d2PAk4xEtclTPuB/1FbHkUKv18DnfJR+bS 7bAtd8Q1caNRGY8uYQfMkzVZEWNvX14lCT+tCgXiTJnuw/ddVi5ypRV6F2cj19anaN XZkr1UvpHVYHae+uYDDnzVxRTz2cH3bJA/Vr/Ufo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50128: android: binder: stop saving a pointer to the VMA Date: Wed, 18 Jun 2025 13:03:13 +0200 Message-ID: <2025061814-CVE-2022-50128-51bc@gregkh> X-Mailer: git-send-email 2.49.0 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=3330; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=SQmAu1ushX0nvMHD3e2OY14TftBMh+nMaK/s4bGw6w4=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlBc6q+zJVabiFaKDW7seTwtPq9bZP/Le10r8g6zz8/U 89DfHFfRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAExk1V2G+YniJybWffl/8n/X /jUJifzNZ+ov7WJYMCHs1YUl7zf9POIn1y50wKXHdoeEJAA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: android: binder: stop saving a pointer to the VMA Do not record a pointer to a VMA outside of the mmap_lock for later use. This is unsafe and there are a number of failure paths *after* the recorded VMA pointer may be freed during setup. There is no callback to the driver to clear the saved pointer from generic mm code. Furthermore, the VMA pointer may become stale if any number of VMA operations end up freeing the VMA so saving it was fragile to being with. Instead, change the binder_alloc struct to record the start address of the VMA and use vma_lookup() to get the vma when needed. Add lockdep mmap_lock checks on updates to the vma pointer to ensure the lock is held and depend on that lock for synchronization of readers and writers - which was already the case anyways, so the smp_wmb()/smp_rmb() was not necessary. [akpm@linux-foundation.org: fix drivers/android/binder_alloc_selftest.c] The Linux kernel CVE team has assigned CVE-2022-50128 to this issue. Affected and fixed versions =========================== Issue introduced in 4.19 with commit da1b9564e85b1d7baf66cbfabcab27e183a1db63 and fixed in 5.15.61 with commit 622ef885a89ad04cfb76ee478fb44f051125d1f1 Issue introduced in 4.19 with commit da1b9564e85b1d7baf66cbfabcab27e183a1db63 and fixed in 5.18.18 with commit 925e6b6f82c9c80ab3c17acbde8d16f349da7d26 Issue introduced in 4.19 with commit da1b9564e85b1d7baf66cbfabcab27e183a1db63 and fixed in 5.19.2 with commit 1ec3f76a436d750fd5023caec5da0494fc2870d2 Issue introduced in 4.19 with commit da1b9564e85b1d7baf66cbfabcab27e183a1db63 and fixed in 6.0 with commit a43cfc87caaf46710c8027a8c23b8a55f1078f19 Issue introduced in 4.14.71 with commit 492519107c9d5ecfe3298586e3f5a33ac968b62c Issue introduced in 4.18.9 with commit 67b9876482580914cfd99d49b54c9b0ed88581a6 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-50128 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_alloc.c drivers/android/binder_alloc.h drivers/android/binder_alloc_selftest.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/622ef885a89ad04cfb76ee478fb44f051125d1f1 https://git.kernel.org/stable/c/925e6b6f82c9c80ab3c17acbde8d16f349da7d26 https://git.kernel.org/stable/c/1ec3f76a436d750fd5023caec5da0494fc2870d2 https://git.kernel.org/stable/c/a43cfc87caaf46710c8027a8c23b8a55f1078f19