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: <9b8357bf-a1bf-43d0-b617-030882540b34@sandeen.net>
Date: Fri, 28 Jun 2024 11:25:10 -0500
From: Eric Sandeen <sandeen@...deen.net>
To: Jiwei Sun <sunjw10@...look.com>, chandan.babu@...cle.com,
 djwong@...nel.org
Cc: linux-xfs@...r.kernel.org, linux-kernel@...r.kernel.org,
 sunjw10@...ovo.com, ahuang12@...ovo.com, yi.zhang@...hat.com
Subject: Re: [PATCH] xfs: add __GFP_NOLOCKDEP when allocating memory in
 xfs_attr_shortform_list()

On 6/27/24 8:12 AM, Jiwei Sun wrote:
> From: Jiwei Sun <sunjw10@...ovo.com>
> 
> If the following configuration is set
> CONFIG_LOCKDEP=y
> 
> The following warning log appears,

Was just about to send this. :)

I had talked to dchinner about this and he also suggested that this was 
missed in the series that removed GFP_NOFS, i.e.

[PATCH 00/12] xfs: remove remaining kmem interfaces and GFP_NOFS usage
at https://lore.kernel.org/linux-mm/20240622094411.GA830005@ceph-admin/T/

So, I think this could also use one or both of:

Fixes: 204fae32d5f7 ("xfs: clean up remaining GFP_NOFS users")
Fixes: 94a69db2367e ("xfs: use __GFP_NOLOCKDEP instead of GFP_NOFS")

...

> This is a false positive. If a node is getting reclaimed, it cannot be
> the target of a flistxattr operation. Commit 6dcde60efd94 ("xfs: more
> lockdep whackamole with kmem_alloc*") has the similar root cause.
> 
> Fix the issue by adding __GFP_NOLOCKDEP in order to shut up lockdep.
> 
> Signed-off-by: Jiwei Sun <sunjw10@...ovo.com>
> Suggested-by: Adrian Huang <ahuang12@...ovo.com>
> ---
>  fs/xfs/xfs_attr_list.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_attr_list.c b/fs/xfs/xfs_attr_list.c
> index 5c947e5ce8b8..506ade0befa4 100644
> --- a/fs/xfs/xfs_attr_list.c
> +++ b/fs/xfs/xfs_attr_list.c
> @@ -114,7 +114,8 @@ xfs_attr_shortform_list(
>  	 * It didn't all fit, so we have to sort everything on hashval.
>  	 */
>  	sbsize = sf->count * sizeof(*sbuf);
> -	sbp = sbuf = kmalloc(sbsize, GFP_KERNEL | __GFP_NOFAIL);
> +	sbp = sbuf = kmalloc(sbsize, GFP_KERNEL | __GFP_NOFAIL |
> +			     __GFP_NOLOCKDEP);

Minor nitpick, style-wise we seem to do:

        sbp = sbuf = kmalloc(sbsize,
                        GFP_KERNEL | __GFP_NOLOCKDEP | __GFP_NOFAIL);

in most other places, and not split the flags onto 2 lines, since you need
to add a line anyway.

Otherwise,

Acked-by: Eric Sandeen <sandeen@...hat.com>
  
>  	/*
>  	 * Scan the attribute list for the rest of the entries, storing


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ