mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Edward Adam Davis <eadavis@qq.com>
To: syzbot+f51a2a34984e4d8888fd@syzkaller.appspotmail.com
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [bfs?] general protection fault in bfs_get_block (3)
Date: Sun,  3 Nov 2024 14:08:10 +0800	[thread overview]
Message-ID: <tencent_357089BF2EF46ECD4C8DE7DF46F312CDC606@qq.com> (raw)
In-Reply-To: <67218131.050a0220.4735a.0265.GAE@google.com>

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);


  parent reply	other threads:[~2024-11-03  6:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-30  0:43 syzbot
2024-11-03  1:37 ` Edward Adam Davis
2024-11-03  1:57   ` syzbot
2024-11-03  4:37 ` Edward Adam Davis
2024-11-03  4:53   ` syzbot
2024-11-03  6:08 ` Edward Adam Davis [this message]
2024-11-03  6:28   ` syzbot
2024-11-03 14:08 ` Edward Adam Davis
2024-11-03 14:33   ` syzbot
2024-11-03 14:36 ` [PATCH] bfs: add check for return value of sb_getblk Edward Adam Davis
2024-11-15 17:58 ` [syzbot] [bfs?] general protection fault in bfs_get_block (3) syzbot
2025-11-19 18:40 ` Forwarded: " syzbot
     [not found] <CAHjv_atfaaAbS_-KWuqV3j4_x1E45BS9oPzM26GeTPvQbzHyvQ@mail.gmail.com>
2025-11-19 19:14 ` [syzbot] [bfs?] " syzbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_357089BF2EF46ECD4C8DE7DF46F312CDC606@qq.com \
    --to=eadavis@qq.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+f51a2a34984e4d8888fd@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®