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] [day] [month] [year] [list]
Message-ID: <a746c612-7cb0-6085-9250-9ddfde8713df@kernel.org>
Date:   Sun, 29 Jan 2023 22:58:55 +0800
From:   Chao Yu <chao@...nel.org>
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     adobriyan@...il.com, viro@...iv.linux.org.uk,
        linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH] proc: remove mark_inode_dirty() in proc_notify_change()

Hi Andrew,

Sorry for the long delay. :(

On 2023/1/13 6:43, Andrew Morton wrote:
> On Thu, 12 Jan 2023 11:27:20 +0800 Chao Yu <chao@...nel.org> wrote:
> 
>> proc_notify_change() has updated i_uid, i_gid and i_mode into proc
>> dirent, we don't need to call mark_inode_dirty() for later writeback,
>> remove it.
>>
>> --- a/fs/proc/generic.c
>> +++ b/fs/proc/generic.c
>> @@ -127,7 +127,6 @@ static int proc_notify_change(struct user_namespace *mnt_userns,
>>   		return error;
>>   
>>   	setattr_copy(&init_user_ns, inode, iattr);
>> -	mark_inode_dirty(inode);
>>   
>>   	proc_set_user(de, inode->i_uid, inode->i_gid);
>>   	de->mode = inode->i_mode;
> 
> procfs call mark_inode_dirty() in three places.

Correct.

> 
> Does mark_inode_dirty() of a procfs file actually serve any purpose?

I don't see any particular reason that procfs inode needs to be set dirty,
as an in-memory filesystem, there is no backing device, so all attributes
should have been updated into procfs dirent directly in .setattr().

In fact, also procfs doesn't implement .dirty_inode, .write_inode or
.writepage{,s} interfaces which serves delayed inode update, pages writeback
after inode is set as dirty.

Thanks,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ