[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_357089BF2EF46ECD4C8DE7DF46F312CDC606@qq.com>
Date: Sun, 3 Nov 2024 14:08:10 +0800
From: Edward Adam Davis <eadavis@...com>
To: syzbot+f51a2a34984e4d8888fd@...kaller.appspotmail.com
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [bfs?] general protection fault in bfs_get_block (3)
add a check for new bh
#syz test
diff --git a/fs/bfs/file.c b/fs/bfs/file.c
index fa66a09e496a..5fb6428d692d 100644
--- a/fs/bfs/file.c
+++ b/fs/bfs/file.c
@@ -40,6 +40,11 @@ static int bfs_move_block(unsigned long from, unsigned long to,
if (!bh)
return -EIO;
new = sb_getblk(sb, to);
+ if (!new || !buffer_uptodate(new)) {
+ bforget(bh);
+ return -ENOMEM;
+ }
+
memcpy(new->b_data, bh->b_data, bh->b_size);
mark_buffer_dirty(new);
bforget(bh);
Powered by blists - more mailing lists