Re: [syzbot] Re: [syzbot] [squashfs?] VFS: Close: file count is zero (use-after-free)

syzbot
2024-06-03T05:51:44Z

linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: Re: [syzbot] [squashfs?] VFS: Close: file count is zero (use-after-free)
Author: nightu.pwn@gmail.com

please test file uaf in udmabuf_create

#syz test
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
0e1980c40b6e

---
drivers/dma-buf/udmabuf.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c
index afa8bfd2a2a9..53035c601e92 100644
--- a/drivers/dma-buf/udmabuf.c
+++ b/drivers/dma-buf/udmabuf.c
@@ -382,6 +382,7 @@ static long udmabuf_create(struct miscdevice *device,

kfree(folios);
fput(memfd);
+ memfd = NULL;
}

flags = head->flags & UDMABUF_FLAGS_CLOEXEC ? O_CLOEXEC : 0;
--

syzbot <syzbot+b2cfdac9ae5278d4b621@syzkaller.appspotmail.com> 于2024年6月3日周一
13:49写道：

> Hello,
>
> syzbot tried to test the proposed patch but the build/boot failed:
>
> failed to apply patch:
> checking file drivers/dma-buf/udmabuf.c
> patch: **** unexpected end of file in patch
>
>
>
> Tested on:
>
> commit: 861a3cb5 Add linux-next specific files for 20240603
> git tree: linux-next
> kernel config: https://syzkaller.appspot.com/x/.config?x=d9c3ca4e54577b88
> dashboard link:
> https://syzkaller.appspot.com/bug?extid=b2cfdac9ae5278d4b621
> compiler:
> patch:
> https://syzkaller.appspot.com/x/patch.diff?x=10a6e206980000
>
>