[PATCH] usbmon: make mmapped memory read only

1 view
Skip to first unread message

Tadeusz Struk

unread,
Sep 16, 2022, 6:10:31 PM9/16/22
to syzbot+23f57c...@syzkaller.appspotmail.com, syzkaller-a...@googlegroups.com, tadeus...@linaro.org
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c
index f48a23adbc35..f452fc03093c 100644
--- a/drivers/usb/mon/mon_bin.c
+++ b/drivers/usb/mon/mon_bin.c
@@ -1268,6 +1268,7 @@ 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;
+ vma->vm_flags &= ~VM_WRITE;
vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
vma->vm_private_data = filp->private_data;
mon_bin_vma_open(vma);
--
2.37.3

syzbot

unread,
Sep 16, 2022, 6:28:22 PM9/16/22
to syzkaller-a...@googlegroups.com, tadeus...@linaro.org
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+23f57c...@syzkaller.appspotmail.com

Tested on:

commit: a335366b Merge tag 'gpio-fixes-for-v6.0-rc6' of git://..
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
console output: https://syzkaller.appspot.com/x/log.txt?x=1759b680880000
kernel config: https://syzkaller.appspot.com/x/.config?x=a3858b37a617f2bb
dashboard link: https://syzkaller.appspot.com/bug?extid=23f57c5ae902429285d7
compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2
patch: https://syzkaller.appspot.com/x/patch.diff?x=1760d5e8880000

Note: testing is done by a robot and is best-effort only.
Reply all
Reply to author
Forward
0 new messages