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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 1 Mar 2017 11:23:37 +0100
From:   Vlastimil Babka <vbabka.lkml@...il.com>
To:     Peter Zijlstra <peterz@...radead.org>,
        Nikolay Borisov <nborisov@...e.com>
Cc:     mingo@...hat.com, linux-kernel@...r.kernel.org,
        ming.lei@...onical.com, minchan@...nel.org, mel@....ul.ie,
        junxiao.bi@...cle.com
Subject: Re: [PATCH v2] lockdep: Teach lockdep about memalloc_noio_save

On 03/01/2017 11:03 AM, Peter Zijlstra wrote:
> On Wed, Mar 01, 2017 at 11:57:13AM +0200, Nikolay Borisov wrote:
>>
>>
>> On  1.03.2017 11:46, Peter Zijlstra wrote:
>>> On Wed, Mar 01, 2017 at 09:59:00AM +0200, Nikolay Borisov wrote:
>>>> Commit 21caf2fc1931 ("mm: teach mm by current context info to not do I/O
>>>> during memory allocation") added the memalloc_noio_(save|restore) functions
>>>> to enable people to modify the MM behavior by disbaling I/O during memory
>>>> allocation. This prevents allocation paths recursing back into the filesystem
>>>> without explicitly changing the flags for every allocation site. Yet, lockdep
>>>> not being aware of that is prone to showing false positives. Fix this
>>>> by teaching it that the presence of PF_MEMALLOC_NOIO flag mean we are not
>>>> going to issue any I/O
>>>
>>> I'm not up to date on the specific, but GFP_IO is separate from GFP_FS.
>>>
>>> And MEMALLOC_NOIO only clears GFP_IO but leaves GFP_FS set.
>>
>> static inline gfp_t memalloc_noio_flags(gfp_t flags)                            
>> {                                                                               
>>     if (unlikely(current->flags & PF_MEMALLOC_NOIO))                            
>>         flags &= ~(__GFP_IO | __GFP_FS);                                        
>>     return flags;                                                               
>> }
>>
> 
> Ah, so in the initial patch you referenced there was:
> 
> +static inline gfp_t memalloc_noio_flags(gfp_t flags)
> +{
> +       if (unlikely(current->flags & PF_MEMALLOC_NOIO))
> +               flags &= ~__GFP_IO;
> +       return flags;
> +}
> 
> OK, so then this commit needs something like:
> 
> Fixes: 934f3072c17c ("mm: clear __GFP_FS when PF_MEMALLOC_NOIO is set")

Agree.

I wonder why this didn't come up much sooner.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ