aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/android/binder_alloc_selftest.c
diff options
context:
space:
mode:
authorCarlos Llamas <[email protected]>2024-12-10 14:31:01 +0000
committerGreg Kroah-Hartman <[email protected]>2024-12-24 08:35:23 +0000
commit072010abc3ad98bc20198dbe60ef13233a0a357c (patch)
tree767cacda44b98f3044b3eaf850aeb18ed64a6108 /drivers/android/binder_alloc_selftest.c
parentbinder: store shrinker metadata under page->private (diff)
downloadkernel-072010abc3ad98bc20198dbe60ef13233a0a357c.tar.gz
kernel-072010abc3ad98bc20198dbe60ef13233a0a357c.zip
binder: replace alloc->vma with alloc->mapped
It is unsafe to use alloc->vma outside of the mmap_sem. Instead, add a new boolean alloc->mapped to save the vma state (mapped or unmmaped) and use this as a replacement for alloc->vma to validate several paths. Using the alloc->vma caused several performance and security issues in the past. Now that it has been replaced with either vm_lookup() or the alloc->mapped state, we can finally remove it. Cc: Minchan Kim <[email protected]> Cc: Liam R. Howlett <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Suren Baghdasaryan <[email protected]> Reviewed-by: Suren Baghdasaryan <[email protected]> Signed-off-by: Carlos Llamas <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/android/binder_alloc_selftest.c')
-rw-r--r--drivers/android/binder_alloc_selftest.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/android/binder_alloc_selftest.c b/drivers/android/binder_alloc_selftest.c
index a4c650843bee..6a64847a8555 100644
--- a/drivers/android/binder_alloc_selftest.c
+++ b/drivers/android/binder_alloc_selftest.c
@@ -291,7 +291,7 @@ void binder_selftest_alloc(struct binder_alloc *alloc)
if (!binder_selftest_run)
return;
mutex_lock(&binder_selftest_lock);
- if (!binder_selftest_run || !alloc->vma)
+ if (!binder_selftest_run || !alloc->mapped)
goto done;
pr_info("STARTED\n");
binder_selftest_alloc_offset(alloc, end_offset, 0);