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] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251009183722.c81e37002e707135da04c94c@linux-foundation.org>
Date: Thu, 9 Oct 2025 18:37:22 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Deepanshu Kartikey <kartikey406@...il.com>
Cc: mark@...heh.com, jlbec@...lplan.org, joseph.qi@...ux.alibaba.com,
 ocfs2-devel@...ts.linux.dev, linux-kernel@...r.kernel.org,
 syzbot+6fdd8fa3380730a4b22c@...kaller.appspotmail.com
Subject: Re: [PATCH v2] ocfs2: clear extent cache after moving/defragmenting
 extents

On Thu,  9 Oct 2025 21:19:03 +0530 Deepanshu Kartikey <kartikey406@...il.com> wrote:

> The extent map cache can become stale when extents are moved or
> defragmented, causing subsequent operations to see outdated extent
> flags. This triggers a BUG_ON in ocfs2_refcount_cal_cow_clusters().

We try to avoid BUG_ONs ;)

>
> ...
>
> The problem occurs when:
>
> ...
>

> --- a/fs/ocfs2/move_extents.c
> +++ b/fs/ocfs2/move_extents.c
> @@ -867,6 +867,11 @@ static int __ocfs2_move_extents_range(struct buffer_head *di_bh,
>  			mlog_errno(ret);
>  			goto out;
>  		}
> +		/*
> +		 * Invalidate extent cache after moving/defragging to prevent
> +		 * stale cached data with outdated extent flags.
> +		 */
> +		ocfs2_extent_map_trunc(inode, cpos);
>  
>  		context->clusters_moved += alloc_size;
>  next:

I assume we should backport this into earlier kernels, so I'll add a
cc:stable to the changelog.

It's very nice (but not essential) to add a Fixes: as well, so -stable
maintainers know how far back in time to backport the fix.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ