linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hfs: don't use BUG() when we can continue
@ 2024-11-23 13:32 Tetsuo Handa
  2024-12-05 13:45 ` [PATCH (REPOST)] " Tetsuo Handa
  0 siblings, 1 reply; 46+ messages in thread
From: Tetsuo Handa @ 2024-11-23 13:32 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: LKML

syzkaller can mount crafted filesystem images.
Don't crash the kernel when we can continue.

Reported-by: syzbot+97e301b4b82ae803d21b@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=97e301b4b82ae803d21b
Tested-by: syzbot+97e301b4b82ae803d21b@syzkaller.appspotmail.com
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
---
 fs/hfs/inode.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c
index a81ce7a740b9..794d710c3ae0 100644
--- a/fs/hfs/inode.c
+++ b/fs/hfs/inode.c
@@ -81,7 +81,7 @@ static bool hfs_release_folio(struct folio *folio, gfp_t mask)
 		tree = HFS_SB(sb)->cat_tree;
 		break;
 	default:
-		BUG();
+		pr_warn("unexpected inode %lu at %s()\n", inode->i_ino, __func__);
 		return false;
 	}
 
@@ -305,7 +305,7 @@ static int hfs_test_inode(struct inode *inode, void *data)
 	case HFS_CDR_FIL:
 		return inode->i_ino == be32_to_cpu(rec->file.FlNum);
 	default:
-		BUG();
+		pr_warn("unexpected type %u at %s()\n", rec->type, __func__);
 		return 1;
 	}
 }
@@ -441,7 +441,7 @@ int hfs_write_inode(struct inode *inode, struct writeback_control *wbc)
 			hfs_btree_write(HFS_SB(inode->i_sb)->cat_tree);
 			return 0;
 		default:
-			BUG();
+			pr_warn("unexpected inode %lu at %s()\n", inode->i_ino, __func__);
 			return -EIO;
 		}
 	}
-- 
2.47.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2025-08-21 10:58 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-23 13:32 [PATCH] hfs: don't use BUG() when we can continue Tetsuo Handa
2024-12-05 13:45 ` [PATCH (REPOST)] " Tetsuo Handa
2024-12-05 13:59   ` Matthew Wilcox
2024-12-05 14:14     ` Tetsuo Handa
2025-06-25  5:03       ` Tetsuo Handa
2025-07-15  6:51         ` [PATCH v2] hfs: remove BUG() from hfs_release_folio()/hfs_test_inode()/hfs_write_inode() Tetsuo Handa
2025-07-15 19:20           ` Viacheslav Dubeyko
2025-07-17 15:30             ` Tetsuo Handa
2025-07-17 15:32               ` [PATCH v3] " Tetsuo Handa
2025-07-17 18:25                 ` Viacheslav Dubeyko
2025-07-17 19:35                 ` Matthew Wilcox
2025-07-17 19:49                   ` Viacheslav Dubeyko
2025-07-17 22:08                     ` Tetsuo Handa
2025-07-21 17:04                       ` Viacheslav Dubeyko
2025-07-22 10:42                         ` Tetsuo Handa
2025-07-22 13:30                           ` Matthew Wilcox
2025-07-22 14:04                             ` Tetsuo Handa
2025-07-22 14:22                               ` Matthew Wilcox
2025-07-22 18:08                                 ` Viacheslav Dubeyko
2025-07-23  1:07                                   ` Tetsuo Handa
2025-07-23  2:16                                     ` Tetsuo Handa
2025-07-23 18:19                                       ` Viacheslav Dubeyko
2025-07-23 18:43                                         ` Viacheslav Dubeyko
2025-07-24  6:55                                           ` Tetsuo Handa
2025-07-24 19:49                                             ` Viacheslav Dubeyko
2025-07-24 22:05                                               ` Tetsuo Handa
2025-07-24 23:20                                                 ` Tetsuo Handa
2025-07-25  4:16                                                   ` Tetsuo Handa
2025-07-25 17:47                                                     ` Viacheslav Dubeyko
2025-07-25 21:52                                                       ` Tetsuo Handa
2025-07-28 19:37                                                         ` Viacheslav Dubeyko
2025-07-28 21:38                                                           ` Tetsuo Handa
2025-07-29 23:21                                                             ` [PATCH v4] hfs: update sanity check of the root record Tetsuo Handa
2025-07-30 19:24                                                               ` Viacheslav Dubeyko
2025-07-30 22:02                                                                 ` Tetsuo Handa
2025-07-31 18:03                                                                   ` Viacheslav Dubeyko
2025-07-31 21:12                                                                     ` Tetsuo Handa
2025-08-01 18:26                                                                       ` Viacheslav Dubeyko
2025-08-01 21:52                                                                         ` Tetsuo Handa
2025-08-04 22:00                                                                           ` Viacheslav Dubeyko
2025-08-21 10:57                                                                             ` Tetsuo Handa
2025-07-25 17:45                                                   ` [PATCH v3] hfs: remove BUG() from hfs_release_folio()/hfs_test_inode()/hfs_write_inode() Viacheslav Dubeyko
2025-07-25 22:25                                                     ` Tetsuo Handa
2025-07-27 13:27                                                       ` Tetsuo Handa
2025-07-25 17:42                                                 ` Viacheslav Dubeyko
2025-07-25 22:22                                                   ` Tetsuo Handa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).