lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5c47b8a5-f9fa-45b1-9966-442a45a4e3b6@linux.alibaba.com>
Date: Fri, 12 Dec 2025 13:48:19 +0800
From: Joseph Qi <joseph.qi@...ux.alibaba.com>
To: Deepanshu Kartikey <kartikey406@...il.com>, mark@...heh.com,
 jlbec@...lplan.org, heming.zhao@...e.com
Cc: ocfs2-devel@...ts.linux.dev, linux-kernel@...r.kernel.org,
 syzbot+6d832e79d3efe1c46743@...kaller.appspotmail.com
Subject: Re: [PATCH v2] ocfs2: validate i_refcount_loc when refcount flag is
 set



On 2025/12/12 12:56, Deepanshu Kartikey wrote:
> Add validation in ocfs2_validate_inode_block() to check that if an
> inode has OCFS2_HAS_REFCOUNT_FL set, it must also have a valid
> i_refcount_loc. A corrupted filesystem image can have this inconsistent
> state, which later triggers a BUG_ON in ocfs2_remove_refcount_tree()
> when the inode is being wiped during unlink.
> 
> Catch this corruption early during inode validation to fail gracefully
> instead of crashing the kernel.
> 
> Reported-by: syzbot+6d832e79d3efe1c46743@...kaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=6d832e79d3efe1c46743
> Tested-by: syzbot+6d832e79d3efe1c46743@...kaller.appspotmail.com
> Signed-off-by: Deepanshu Kartikey <kartikey406@...il.com>
> ---
> v2: Shortened error message to fix line length (Heming Zhao)
> ---
>  fs/ocfs2/inode.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c
> index 78f81950c9ee..06f1f9e21423 100644
> --- a/fs/ocfs2/inode.c
> +++ b/fs/ocfs2/inode.c
> @@ -1484,6 +1484,13 @@ int ocfs2_validate_inode_block(struct super_block *sb,
>  		goto bail;
>  	}
>  
> +	if ((di->i_dyn_features & cpu_to_le16(OCFS2_HAS_REFCOUNT_FL)) &&

I'd like to covert it to host endian to keep consistent with other checks.

Thanks,
Joseph

> +	    !di->i_refcount_loc) {
> +		rc = ocfs2_error(sb, "Inode #%llu has refcount flag but no i_refcount_loc\n",
> +				(unsigned long long)bh->b_blocknr);
> +		goto bail;
> +	}
> +
>  	rc = 0;
>  
>  bail:


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ