diff options
| author | Takashi Iwai <[email protected]> | 2022-12-22 08:11:48 +0000 |
|---|---|---|
| committer | Takashi Iwai <[email protected]> | 2022-12-22 08:11:48 +0000 |
| commit | 2d78eb0342dd2c9c5cde9ae9ada1d33f189a858b (patch) | |
| tree | f711bc9cab45f4963e4883ef15ff4c54a6cbc12e /drivers/android/binder_alloc.c | |
| parent | Merge tag 'asoc-fix-v6.1-rc7' of https://git.kernel.org/pub/scm/linux/kernel/... (diff) | |
| parent | ALSA: hda/hdmi: fix stream-id config keep-alive for rt suspend (diff) | |
| download | kernel-2d78eb0342dd2c9c5cde9ae9ada1d33f189a858b.tar.gz kernel-2d78eb0342dd2c9c5cde9ae9ada1d33f189a858b.zip | |
Merge branch 'for-next' into for-linus
Diffstat (limited to 'drivers/android/binder_alloc.c')
| -rw-r--r-- | drivers/android/binder_alloc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c index 1c39cfce32fa..4ad42b0f75cd 100644 --- a/drivers/android/binder_alloc.c +++ b/drivers/android/binder_alloc.c @@ -739,6 +739,12 @@ int binder_alloc_mmap_handler(struct binder_alloc *alloc, const char *failure_string; struct binder_buffer *buffer; + if (unlikely(vma->vm_mm != alloc->mm)) { + ret = -EINVAL; + failure_string = "invalid vma->vm_mm"; + goto err_invalid_mm; + } + mutex_lock(&binder_alloc_mmap_lock); if (alloc->buffer_size) { ret = -EBUSY; @@ -785,6 +791,7 @@ err_alloc_pages_failed: alloc->buffer_size = 0; err_already_mapped: mutex_unlock(&binder_alloc_mmap_lock); +err_invalid_mm: binder_alloc_debug(BINDER_DEBUG_USER_ERROR, "%s: %d %lx-%lx %s failed %d\n", __func__, alloc->pid, vma->vm_start, vma->vm_end, |
