public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [syzbot] kernel BUG in __ocfs2_page_mkwrite
       [not found] <177644287830.3790093.7729454483587611807@talencesecurity.com>
@ 2026-04-17 16:21 ` syzbot
  0 siblings, 0 replies; only message in thread
From: syzbot @ 2026-04-17 16:21 UTC (permalink / raw)
  To: tristmd; +Cc: tristmd, linux-kernel, syzkaller-bugs

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

This crash does not have a reproducer. I cannot test it.

>>From c2c3a03773b08b55240f1a32b79b20b57bb88076 Mon Sep 17 00:00:00 2001
> From: Tristan Madani <tristan@talencesecurity.com>
> Date: Fri, 17 Apr 2026 16:15:19 +0000
> Subject: [PATCH] ocfs2: replace BUG_ON with error return in
>  __ocfs2_page_mkwrite()
> __ocfs2_page_mkwrite() uses BUG_ON(err != len) after
> ocfs2_write_end_nolock(). On corrupted filesystems, a short
> write triggers a kernel panic. Replace with proper error
> handling that returns VM_FAULT_SIGBUS to userspace.
> Reported-by: syzbot+ea5aff81e35d189b9335@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=ea5aff81e35d189b9335
> Signed-off-by: Tristan Madani <tristan@talencesecurity.com>
> ---
>  fs/ocfs2/mmap.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> diff --git a/fs/ocfs2/mmap.c b/fs/ocfs2/mmap.c
> index 6c57015..d999d88 100644
> --- a/fs/ocfs2/mmap.c
> +++ b/fs/ocfs2/mmap.c
> @@ -103,7 +103,12 @@ static vm_fault_t __ocfs2_page_mkwrite(struct file *file,
>  		goto out;
>  	}
>  	err = ocfs2_write_end_nolock(mapping, pos, len, len, fsdata);
> -	BUG_ON(err != len);
> +	if (unlikely(err != len)) {
> +		if (err >= 0)
> +			err = -EIO;
> +		ret = vmf_error(err);
> +		goto out;
> +	}
>  	ret = VM_FAULT_LOCKED;
>  out:
>  	return ret;
> -- 
> 2.47.3

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-04-17 16:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <177644287830.3790093.7729454483587611807@talencesecurity.com>
2026-04-17 16:21 ` [syzbot] kernel BUG in __ocfs2_page_mkwrite syzbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox