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: <tgj6l2ymwspc7gd4mexoxtey27ewmrgj42mdozxmr7uymtubqr@q46d6tdh7kid>
Date: Tue, 15 Apr 2025 13:08:46 +0200
From: Jan Kara <jack@...e.cz>
To: Lizhi Xu <lizhi.xu@...driver.com>
Cc: jack@...e.cz, almaz.alexandrovich@...agon-software.com, 
	brauner@...nel.org, hch@...radead.org, linux-fsdevel@...r.kernel.org, 
	linux-kernel@...r.kernel.org, ntfs3@...ts.linux.dev, 
	syzbot+e36cc3297bd3afd25e19@...kaller.appspotmail.com, syzkaller-bugs@...glegroups.com, viro@...iv.linux.org.uk
Subject: Re: [PATCH V2] fs/ntfs3: Add missing direct_IO in ntfs_aops_cmpr

On Tue 15-04-25 17:26:37, Lizhi Xu wrote:
> The ntfs3 can use the page cache directly, so its address_space_operations
> need direct_IO. Exit ntfs_direct_IO() if it is a compressed file.
> 
> Fixes: b432163ebd15 ("fs/ntfs3: Update inode->i_mapping->a_ops on compression state")
> Reported-by: syzbot+e36cc3297bd3afd25e19@...kaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=e36cc3297bd3afd25e19
> Signed-off-by: Lizhi Xu <lizhi.xu@...driver.com>

OK, this looks sensible to me. Feel free to add:

Reviewed-by: Jan Kara <jack@...e.cz>

								Honza

> ---
> V1 -> V2: exit direct io if it is a compressed file.
> 
>  fs/ntfs3/inode.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c
> index 3e2957a1e360..0f0d27d4644a 100644
> --- a/fs/ntfs3/inode.c
> +++ b/fs/ntfs3/inode.c
> @@ -805,6 +805,10 @@ static ssize_t ntfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
>  		ret = 0;
>  		goto out;
>  	}
> +	if (is_compressed(ni)) {
> +		ret = 0;
> +		goto out;
> +	}
>  
>  	ret = blockdev_direct_IO(iocb, inode, iter,
>  				 wr ? ntfs_get_block_direct_IO_W :
> @@ -2068,5 +2072,6 @@ const struct address_space_operations ntfs_aops_cmpr = {
>  	.read_folio	= ntfs_read_folio,
>  	.readahead	= ntfs_readahead,
>  	.dirty_folio	= block_dirty_folio,
> +	.direct_IO	= ntfs_direct_IO,
>  };
>  // clang-format on
> -- 
> 2.43.0
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ