aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/mon/mon_bin.c
diff options
context:
space:
mode:
authorSiluxsept <ronny.horn.rh@gmail.com>2024-02-06 04:37:40 +0100
committerSiluxsept <ronny.horn.rh@gmail.com>2024-02-06 04:38:56 +0100
commit8e8137ac800bdc27181743ec73d0e90e28b4e8af (patch)
tree7e2fbc9d9e305e46414c21d08eeaeb1d56ccb0f0 /drivers/usb/mon/mon_bin.c
parent9c2f9bfc860f0cd6f2d3320b5f72a0f4adf24b25 (diff)
merge branch lineage-20 into t13.0t13.0
https: //github.com/LineageOS/android_kernel_google_redbull Change-Id: I4a450eb794cc99abf711ad3b5b82946092be84ba
Diffstat (limited to 'drivers/usb/mon/mon_bin.c')
-rw-r--r--drivers/usb/mon/mon_bin.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c
index f48a23adbc35..094e812e9e69 100644
--- a/drivers/usb/mon/mon_bin.c
+++ b/drivers/usb/mon/mon_bin.c
@@ -1268,6 +1268,11 @@ static int mon_bin_mmap(struct file *filp, struct vm_area_struct *vma)
{
/* don't do anything here: "fault" will set up page table entries */
vma->vm_ops = &mon_bin_vm_ops;
+
+ if (vma->vm_flags & VM_WRITE)
+ return -EPERM;
+
+ vma->vm_flags &= ~VM_MAYWRITE;
vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
vma->vm_private_data = filp->private_data;
mon_bin_vma_open(vma);