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:   Tue, 16 Nov 2021 14:57:28 +0800
From:   Jubin Zhong <zhongjubin@...wei.com>
To:     <hch@...radead.org>
CC:     <kechengsong@...wei.com>, <linux-fsdevel@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <viro@...iv.linux.org.uk>,
        <wangfangpeng1@...wei.com>, <zhongjubin@...wei.com>
Subject: Re: [PATCH] fs: Fix truncate never updates m/ctime

> It seems like you need to fix jffs2 to implement the proper semantics in its ->setattr.

Yes I have thought of this solution. However, when I tried to
track this problem down, I found that ftruncate() had similar
problem and it was fixed by commit 6e656be89999 ("ftruncate 
does not always update m/ctime"):

	diff --git a/fs/open.c b/fs/open.c
	index 5fb16e5267dc..303f06d2a7b9 100644
	--- a/fs/open.c
	+++ b/fs/open.c
	@@ -322,7 +322,7 @@ static long do_sys_ftruncate(unsigned int fd, loff_t length, int small)
 
        error = locks_verify_truncate(inode, file, length);
        if (!error)
	-   	error = do_truncate(dentry, length, 0, file);
	+   	error = do_truncate(dentry, length, ATTR_MTIME|ATTR_CTIME, file);
 	out_putf:
        fput(file);
	 out:

In my opinion, there are two advantages if we fix it in
vfs_truncate():

1. All filesystems can reuse the scheme without adapting
Separately, just like what we did for ftruncate().

2. In the case when old_size = new_size, we can avoid
calling do_truncate() and return without doing anything.

Hope that you can consider my suggestion, thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ