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]
Date:   Wed, 4 Apr 2018 09:03:47 -0700
From:   Joel Fernandes <joelaf@...gle.com>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Michal Hocko <mhocko@...nel.org>,
        Zhaoyang Huang <huangzhaoyang@...il.com>,
        Ingo Molnar <mingo@...nel.org>,
        kernel-patch-test@...ts.linaro.org,
        Andrew Morton <akpm@...ux-foundation.org>,
        "open list:MEMORY MANAGEMENT" <linux-mm@...ck.org>,
        Vlastimil Babka <vbabka@...e.cz>
Subject: Re: [PATCH] ring-buffer: Add set/clear_current_oom_origin() during allocations

On Wed, Apr 4, 2018 at 9:00 AM, Steven Rostedt <rostedt@...dmis.org> wrote:
> On Wed, 4 Apr 2018 11:53:10 -0400
> Steven Rostedt <rostedt@...dmis.org> wrote:
>
>> @@ -1162,35 +1163,60 @@ static int rb_check_pages(struct ring_buffer_per_cpu *cpu_buffer)
>>  static int __rb_allocate_pages(long nr_pages, struct list_head *pages, int cpu)
>>  {
>>       struct buffer_page *bpage, *tmp;
>> +     bool user_thread = current->mm != NULL;
>> +     gfp_t mflags;
>>       long i;
>>
>> -     /* Check if the available memory is there first */
>> +     /*
>> +      * Check if the available memory is there first.
>> +      * Note, si_mem_available() only gives us a rough estimate of available
>> +      * memory. It may not be accurate. But we don't care, we just want
>> +      * to prevent doing any allocation when it is obvious that it is
>> +      * not going to succeed.
>> +      */
>
> In case you are wondering how I tested this, I simply added:
>
> #if 0
>>       i = si_mem_available();
>>       if (i < nr_pages)
>>               return -ENOMEM;
> #endif
>
> for the tests. Note, without this, I tried to allocate all memory
> (bisecting it with allocations that failed and allocations that
> succeeded), and couldn't trigger an OOM :-/

I guess you need to have something *else* other than the write to
buffer_size_kb doing the GFP_KERNEL allocations but unfortunately gets
OOM killed?

Also, I agree with the new patch and its nice idea to do that.

thanks,

- Joel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ