Re: [syzbot] Test patch

From: syzbot
Date: Sun Nov 26 2023 - 18:28:29 EST


For archival purposes, forwarding an incoming command email to
linux-kernel@xxxxxxxxxxxxxxx, syzkaller-bugs@xxxxxxxxxxxxxxxx.

***

Subject: Test patch
Author: yuran.pereira@xxxxxxxxxxx

#syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

---
fs/bfs/file.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/fs/bfs/file.c b/fs/bfs/file.c
index adc2230079c6..8a97909b1484 100644
--- a/fs/bfs/file.c
+++ b/fs/bfs/file.c
@@ -38,7 +38,12 @@ static int bfs_move_block(unsigned long from, unsigned long to,
bh = sb_bread(sb, from);
if (!bh)
return -EIO;
+
new = sb_getblk(sb, to);
+ if (!new) {
+ bforget(bh);
+ return -ENOMEM;
+ }
memcpy(new->b_data, bh->b_data, bh->b_size);
mark_buffer_dirty(new);
bforget(bh);
--
2.25.1