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]
Date:   Mon, 15 Nov 2021 09:58:07 -0800
From:   Christoph Hellwig <hch@...radead.org>
To:     Jubin Zhong <zhongjubin@...wei.com>
Cc:     viro@...iv.linux.org.uk, wangfangpeng1@...wei.com,
        kechengsong@...wei.com, linux-fsdevel@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fs: Fix truncate never updates m/ctime

On Mon, Nov 15, 2021 at 07:00:18PM +0800, Jubin Zhong wrote:
> From: zhongjubin <zhongjubin@...wei.com>
> 
> Syscall truncate() never updates m/ctime even if the file size is
> changed. However, this is incorrect according to man file:
> 
>   truncate (2):
>   If  the  size  changed, then the st_ctime and st_mtime fields
>   (respectively, time of last status change and time of last modification;
>   see stat(2)) for the file are updated, and the set-user-ID and
>   set-group-ID mode bits may be cleared.
> 
> Check file size before do_truncate() to fix this.

Please try to actually reproduce your alleged "bug".  And maybe also
look at the actual setattr implementations.  Hint: The XFS one even
has extensive comments.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ