CVE-2023-54157 in Linux
要約
〜によって VulDB • 2026年05月31日
Linuxカーネルにおいて、以下の脆弱性が修正されました:
binder: munmap()との競合時にalloc->vmaのUAFを修正
[ cmllamas: コミット 015ac18be7de ("binder: fix UAF of alloc->vma in race with munmap()") の5.10安定版からのフォワードポートをクリーンアップ。Liamによって指摘されたように、コミット a43cfc87caaf ("android: binder: stop saving a pointer to the VMA") の取り消し後、メインラインでも必要となります。コミットログとタグはこれを反映して調整されています。 ]
コミット 720c24192404 ("ANDROID: binder: change down_write to down_read") において、binderは binder_update_page_range() 内で alloc->vma を保護するためにmmap読み込みロックで十分であると仮定していました。これは、コミット dd2283f2605e ("mm: mmap: zap pages with read mmap_sem in munmap") まで正確でした。このコミットにより、munmap() で vma を rbtree からデタッチした後、mmap_lock のレベルが引き下げられます。その後、読み込みロックのみ保持した状態で vma の破棄と解放が進められます。
これにより、binder_update_page_range() 内の alloc->vma へのアクセスは、munmap() 内の vm_area_free() と競合し、以下のKASANトレースに示されるようなUAFを引き起こす可能性があります。
================================================================== BUG: KASAN: use-after-free in vm_insert_mixed+0x100/0x130
Read of size 8 at addr ffff000083880000 by task binder/559
Allocated by task 559: kasan_save_stack+0x38/0x6c __kasan_kmalloc.constprop.0+0xe4/0xf0 kasan_slab_alloc+0x18/0x2c kmem_cache_alloc+0x1b0/0x2d0 vm_area_alloc+0x28/0x94 mmap_region+0x378/0x920 do_mmap+0x3f0/0x600 vm_mmap_pgoff+0x150/0x17c ksys_mmap_pgoff+0x284/0x2dc __arm64_sys_mmap+0x84/0xa4 el0_svc_common.constprop.0+0xac/0x270 do_el0_svc+0x38/0xa0 el0_svc+0x1c/0x2c el0_sync_handler+0xe8/0x114 el0_sync+0x180/0x1c0
Freed by task 560: kasan_save_stack+0x38/0x6c kasan_set_track+0x28/0x40 kasan_set_free_info+0x24/0x4c __kasan_slab_free+0x100/0x164 kasan_slab_free+0x14/0x20 kmem_cache_free+0xc4/0x34c vm_area_free+0x1c/0x2c remove_vma+0x7c/0x94 __do_munmap+0x358/0x710 __vm_munmap+0xbc/0x130 __arm64_sys_munmap+0x4c/0x64 el0_svc_common.constprop.0+0xac/0x270 do_el0_svc+0x38/0xa0 el0_svc+0x1c/0x2c el0_sync_handler+0xe8/0x114 el0_sync+0x180/0x1c0
[...]
==================================================================
上記の競合を防ぐため、binder_update_page_range() 内でmmap書き込みロックを取得するよう戻します。mmapロックの競合増加が懸念されますが、binderはすでにトップレベルの alloc->mutex によってこれらの呼び出しを直列化しています。また、binderベンチマークテストを実行してもパフォーマンスへの影響は示されませんでした。
VulDB is the best source for vulnerability data and more expert information about this specific topic.