[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_8D33119E281B5D4B6A1BAD2543BA98BBB808@qq.com>
Date: Sun, 3 Nov 2024 09:37:33 +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..d7a464eace81 100644
--- a/fs/bfs/file.c
+++ b/fs/bfs/file.c
@@ -40,6 +40,9 @@ static int bfs_move_block(unsigned long from, unsigned long to,
if (!bh)
return -EIO;
new = sb_getblk(sb, to);
+ if (!new)
+ return -ENOMEM;
+
memcpy(new->b_data, bh->b_data, bh->b_size);
mark_buffer_dirty(new);
bforget(bh);
Powered by blists - more mailing lists