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: <Zv6sU5eF4OCPTzNH@infradead.org>
Date: Thu, 3 Oct 2024 07:38:11 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Ojaswin Mujoo <ojaswin@...ux.ibm.com>
Cc: linux-xfs@...r.kernel.org, Ritesh Harjani <ritesh.list@...il.com>,
	linux-kernel@...r.kernel.org,
	"Darrick J . Wong" <djwong@...nel.org>, dchinner@...hat.com,
	Chandan Babu R <chandan.babu@...cle.com>
Subject: Re: [PATCH] xfs: Check for deallayed allocations before setting
 extsize

On Thu, Oct 03, 2024 at 03:42:07PM +0530, Ojaswin Mujoo wrote:
> Extsize is allowed to be set on files with no data in it. For this,
> we were checking if the files have extents but missed to check if
> delayed extents were present. This patch adds that check.
> 
> **Without the patch (SUCCEEDS)**
> 
> $ xfs_io -c 'open -f testfile' -c 'pwrite 0 1024' -c 'extsize 65536'

Can you add a testcase for this to xfstests?

> -	if (S_ISREG(VFS_I(ip)->i_mode) && ip->i_df.if_nextents &&
> +	if (S_ISREG(VFS_I(ip)->i_mode) &&
> +	    (ip->i_df.if_nextents || ip->i_delayed_blks) &&

We have two other copies of the

	ip->i_df.if_nextents || ip->i_delayed_blks

pattern to check if there is any data on the inode in xfs_inactive and
xfs_ioctl_setattr_xflags.  Maybe facto this into a documented helper?

Otherwise looks good:

Reviewed-by: Christoph Hellwig <hch@....de>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ