CVE-2022-49947

Source
https://cve.org/CVERecord?id=CVE-2022-49947
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49947.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-49947
Downstream
Published
2025-06-18T11:00:11.012Z
Modified
2026-04-02T08:28:05.109685Z
Summary
binder: fix alloc->vma_vm_mm null-ptr dereference
Details

In the Linux kernel, the following vulnerability has been resolved:

binder: fix alloc->vmavmmm null-ptr dereference

Syzbot reported a couple issues introduced by commit 44e602b4e52f ("binderalloc: add missing mmaplock calls when using the VMA"), in which we attempt to acquire the mmaplock when alloc->vmavm_mm has not been initialized yet.

This can happen if a binderproc receives a transaction without having previously called mmap() to setup the binderproc->alloc space in [1]. Also, a similar issue occurs via binderallocprint_pages() when we try to dump the debugfs binder stats file in [2].

Sample of syzbot's crash report: ================================================================== KASAN: null-ptr-deref in range [0x0000000000000128-0x000000000000012f] CPU: 0 PID: 3755 Comm: syz-executor229 Not tainted 6.0.0-rc1-next-20220819-syzkaller #0 syz-executor229[3755] cmdline: ./syz-executor2294415195 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022 RIP: 0010:__lockacquire+0xd83/0x56d0 kernel/locking/lockdep.c:4923 [...] Call Trace: <TASK> lockacquire kernel/locking/lockdep.c:5666 [inline] lockacquire+0x1ab/0x570 kernel/locking/lockdep.c:5631 downread+0x98/0x450 kernel/locking/rwsem.c:1499 mmapreadlock include/linux/mmaplock.h:117 [inline] binderallocnewbuflocked drivers/android/binderalloc.c:405 [inline] binderallocnewbuf+0xa5/0x19e0 drivers/android/binderalloc.c:593 bindertransaction+0x242e/0x9a80 drivers/android/binder.c:3199 binderthreadwrite+0x664/0x3220 drivers/android/binder.c:3986 binderioctlwriteread drivers/android/binder.c:5036 [inline] binderioctl+0x3470/0x6d00 drivers/android/binder.c:5323 vfsioctl fs/ioctl.c:51 [inline] __dosysioctl fs/ioctl.c:870 [inline] __sesysioctl fs/ioctl.c:856 [inline] __x64sysioctl+0x193/0x200 fs/ioctl.c:856 dosyscallx64 arch/x86/entry/common.c:50 [inline] dosyscall64+0x35/0xb0 arch/x86/entry/common.c:80 entrySYSCALL64afterhwframe+0x63/0xcd [...] ==================================================================

Fix these issues by setting up alloc->vmavmmm pointer during open() and caching directly from current->mm. This guarantees we have a valid reference to take the mmap_lock during scenarios described above.

[1] https://syzkaller.appspot.com/bug?extid=f7dc54e5be28950ac459 [2] https://syzkaller.appspot.com/bug?extid=a75ebe0452711c9e56d9

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49947.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
577d9c05cc48c5242bcf719c06a5baf3105473ad
Fixed
81203ab7a6ef843a2b904a0a494f28c457d44d27
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
7b0163c1b07b7ff1717aa975821c40df98786ddc
Fixed
b2a97babb0a510f8921891f9e70c5a5ef33cadac
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
44e602b4e52f70f04620bbbf4fe46ecb40170bde
Fixed
1da52815d5f1b654c89044db0cdc6adce43da1f1

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49947.json"