Re: [PATCH] rust_binder: check VMA bounds before calling zap_vma_range()

From: FUJITA Tomonori

Date: Tue Dec 01 2026 - 05:47:17 EST


On Tue, 01 Dec 2026 10:19:27 +0000
Alice Ryhl <aliceryhl@xxxxxxxxxx> wrote:

> If userspace partially unmaps the tail of a binder VMA, the shrinker
> still finds the shortened VMA at `vma_addr` and passes an out-of-bounds
> `user_page_addr` to zap_vma_range().
>
> Currently this out-of-bounds operation leads to zap_vma_range() printing
> a warning and doing nothing. However, this warning has a TODO to replace

zap_vma_range() doesn't print anything currently. It just returns.

I tested this with my reproducer, after changing the TODO in
zap_vma_range() to warn_on!(true). Without this patch, the warning is
triggered. With this patch, it is not.

Tested-by: FUJITA Tomonori <fujita.tomonori@xxxxxxxxx>
Reviewed-by: FUJITA Tomonori <fujita.tomonori@xxxxxxxxx>