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]
Date:   Thu, 19 Oct 2023 14:10:57 +0200
From:   Jan Kara <>
To:     Joseph Qi <>
Cc:     Jan Kara <>, Ted Tso <>,,
        "Ritesh Harjani (IBM)" <>,
        Gao Xiang <>,
        Dave Chinner <>,
        Joseph Qi <>
Subject: Re: [PATCH v3] ext4: Properly sync file size update after O_SYNC
 direct IO

On Wed 18-10-23 14:45:49, Joseph Qi wrote:
> On 10/13/23 8:13 PM, Jan Kara wrote:
> > Gao Xiang has reported that on ext4 O_SYNC direct IO does not properly
> > sync file size update and thus if we crash at unfortunate moment, the
> > file can have smaller size although O_SYNC IO has reported successful
> > completion. The problem happens because update of on-disk inode size is
> > handled in ext4_dio_write_iter() *after* iomap_dio_rw() (and thus
> > dio_complete() in particular) has returned and generic_file_sync() gets
> > called by dio_complete(). Fix the problem by handling on-disk inode size
> > update directly in our ->end_io completion handler.
> > 
> > References:
> > Reported-by: Gao Xiang <>
> > CC:
> > Fixes: 378f32bab371 ("ext4: introduce direct I/O write using iomap infrastructure")
> > Signed-off-by: Jan Kara <>
> Tested with the reproducer after applying to 6.6-rc5,
> Tested-by: Joseph Qi <>

Thanks for testing!

> BTW, once backported to older kernel like 5.10, it seems that it depends
> on the following commit:
> 936e114a245b iomap: update ki_pos a little later in iomap_dio_complete
> Otherwise, it will fail the following xfstests cases:
> generic/091 generic/094 generic/225 generic/263 generic/311 generic/617

That is kind of curious because that commit should not influence how the
ext4 fix behaves. It only influences what is in iocb->ki_pos when we are
invalidating pagecache pages...

Jan Kara <>

Powered by blists - more mailing lists