public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: "driz2t@qq.com" <driz2t@qq.com>
Cc: stable <stable@vger.kernel.org>,
	"syzbot+1dd53396e7124586dca9@syzkaller.appspotmail.com"
	<syzbot+1dd53396e7124586dca9@syzkaller.appspotmail.com>,
	"joseph.qi" <joseph.qi@linux.alibaba.com>, mark <mark@fasheh.com>,
	jlbec <jlbec@evilplan.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 6.6.y] kernel BUG in ocfs2_remove_extent
Date: Sun, 29 Mar 2026 08:37:24 +0200	[thread overview]
Message-ID: <2026032938-shorthand-iron-e628@gregkh> (raw)
In-Reply-To: <tencent_20BE792225EC3654239D0B90001A911DE909@qq.com>

On Sun, Mar 29, 2026 at 06:09:02AM +0000, driz2t@qq.com wrote:
> This is a backport for 6.6.y.

Not needed here.

> 
> [ Upstream commit e1c70505ee8158c1108340d9cd67182ade93af4a ]
> 
> ocfs2: add extra consistency checks for chain allocator dinodes
> 
> When validating chain allocator dinode in 'ocfs2_validate_inode_block()',
> add an extra checks whether a) the maximum amount of chain records in
> 'struct ocfs2_chain_list' matches the value calculated based on the
> filesystem block size, and b) the next free slot index is within the valid
> range.
> 
> Link: https://lkml.kernel.org/r/20251030153003.1934585-1-dmantipov@yandex.ru
> Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
> Reported-by: syzbot+77026564530dbc29b854@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=77026564530dbc29b854
> Reported-by: syzbot+5054473a31f78f735416@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=5054473a31f78f735416
> Suggested-by: Joseph Qi <joseph.qi@linux.alibaba.com>
> Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
> Tested-by: syzbot+1dd53396e7124586dca9@syzkaller.appspotmail.com
> Signed-off-by: Changjian Liu <driz2t@qq.com>

Why did you take off the signed-off-by line that was on the original?


> ---
>  fs/ocfs2/inode.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c
> index c561a8a6493e..7c99f436037b 100644
> --- a/fs/ocfs2/inode.c
> +++ b/fs/ocfs2/inode.c
> @@ -1419,6 +1419,23 @@ int ocfs2_validate_inode_block(struct super_block *sb,
>             goto bail;
>       }
>  
> +     if (le32_to_cpu(di->i_flags) & OCFS2_CHAIN_FL) {
> +           struct ocfs2_chain_list *cl = &di->id2.i_chain;
> +
> +           if (le16_to_cpu(cl->cl_count) != ocfs2_chain_recs_per_inode(sb)) {
> +                 rc = ocfs2_error(sb, "Invalid dinode %llu: chain list count %u\n",
> +                              (unsigned long long)bh->b_blocknr,
> +                              le16_to_cpu(cl->cl_count));
> +                 goto bail;
> +           }
> +           if (le16_to_cpu(cl->cl_next_free_rec) > le16_to_cpu(cl->cl_count)) {
> +                 rc = ocfs2_error(sb, "Invalid dinode %llu: chain list index %u\n",
> +                              (unsigned long long)bh->b_blocknr,
> +                              le16_to_cpu(cl->cl_next_free_rec));
> +                 goto bail;
> +           }
> +     }
> +
>       rc = 0;
>  
>  bail:
> --
> 2.43.0

Did you try to apply this patch to the tree?  (hint, it is corrupted...)

thanks,

greg k-h

      reply	other threads:[~2026-03-29  6:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-29  6:09 [PATCH 6.6.y] kernel BUG in ocfs2_remove_extent driz2t
2026-03-29  6:37 ` Greg KH [this message]

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=2026032938-shorthand-iron-e628@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=driz2t@qq.com \
    --cc=jlbec@evilplan.org \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark@fasheh.com \
    --cc=stable@vger.kernel.org \
    --cc=syzbot+1dd53396e7124586dca9@syzkaller.appspotmail.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