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]
Date: Sat, 29 Jun 2024 07:31:40 +0800
From: Jiwei Sun <sunjw10@...look.com>
To: "Darrick J. Wong" <djwong@...nel.org>, Eric Sandeen <sandeen@...deen.net>
Cc: chandan.babu@...cle.com, 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/29/24 01:01, Darrick J. Wong wrote:
> On Fri, Jun 28, 2024 at 11:25:10AM -0500, Eric Sandeen wrote:
>> 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>
> 
> Hey, could you all please read the list before sending duplicate
> patches?

I'm very sorry for wasting everyone's time because of missing that patch.
Thank you for pointing out this point, @Darrick.
And thank you also for your review and suggestions, @Eric.

Thanks,
Regards,
Jiwei

> 
> https://lore.kernel.org/linux-xfs/20240622082631.2661148-1-leo.lilong@huawei.com/
> 
> --D
> 
>>>  	/*
>>>  	 * 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