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: <53c4968b-c083-4d69-9562-31e155a34a1e@huawei.com>
Date: Wed, 26 Nov 2025 11:41:06 +0800
From: Baokun Li <libaokun1@...wei.com>
To: Jan Kara <jack@...e.cz>
CC: Ted Tso <tytso@....edu>, <linux-ext4@...r.kernel.org>, Mateusz Guzik
	<mjguzik@...il.com>, Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH] ext4: Mark inodes without acls in __ext4_iget()

On 2025-11-25 18:13, Jan Kara wrote:
> Mark inodes without acls with cache_no_acl() in __ext4_iget() so that
> path lookup can run in RCU mode from the start. This is interesting in
> particular for the case where the file owner does the lookup because in
> that case end up constantly hitting the slow path otherwise. We drop out
> from the fast path (because ACL state is unknown) but never end up calling
> check_acl() to cache ACL state.
>
> The problem was originally analyzed by Linus and fix tested by Matheusz,
> I'm just putting it into mergeable form :).
>
> Link: https://lore.kernel.org/all/CAHk-=whSzc75TLLPWskV0xuaHR4tpWBr=LduqhcCFr4kCmme_w@mail.gmail.com
> Reported-by: Mateusz Guzik <mjguzik@...il.com>
> Reported-by: Linus Torvalds <torvalds@...ux-foundation.org>
> Signed-off-by: Jan Kara <jack@...e.cz>

Looks good! Feel free to add:

Reviewed-by: Baokun Li <libaokun1@...wei.com>

> ---
>  fs/ext4/inode.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index e99306a8f47c..2b68d0651652 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -5521,7 +5521,9 @@ struct inode *__ext4_iget(struct super_block *sb, unsigned long ino,
>  	if (ret)
>  		goto bad_inode;
>  	brelse(iloc.bh);
> -
> +	/* Initialize the "no ACL's" state for the simple cases */
> +	if (!ext4_test_inode_state(inode, EXT4_STATE_XATTR) && !ei->i_file_acl)
> +		cache_no_acl(inode);
>  	unlock_new_inode(inode);
>  	return inode;
>  



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ