| From: Andrew Morton <akpm@linux-foundation.org> |
| Subject: mm-replace-vma-vm_flags-direct-modifications-with-modifier-calls-fix |
| Date: Tue Jan 31 12:50:59 PM PST 2023 |
| |
| fix drivers/misc/open-dice.c, per Hyeonggon Yoo |
| |
| Cc: Suren Baghdasaryan <surenb@google.com> |
| Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com> |
| Signed-off-by: Andrew Morton <akpm@linux-foundation.org> |
| --- |
| |
| |
| --- a/drivers/misc/open-dice.c~mm-replace-vma-vm_flags-direct-modifications-with-modifier-calls-fix |
| +++ a/drivers/misc/open-dice.c |
| @@ -95,7 +95,7 @@ static int open_dice_mmap(struct file *f |
| if (vma->vm_flags & VM_WRITE) |
| return -EPERM; |
| /* Ensure userspace cannot acquire VM_WRITE later. */ |
| - vm_flags_clear(vma, VM_MAYSHARE); |
| + vm_flags_clear(vma, VM_MAYWRITE); |
| } |
| |
| /* Create write-combine mapping so all clients observe a wipe. */ |
| _ |