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] [day] [month] [year] [list]
Message-ID: <CALYGNiNXam-yZK1DS5D1_yCC2_607KBvs6dgSL1rc0r48WCEMA@mail.gmail.com>
Date:	Sun, 24 Apr 2016 23:40:00 +0300
From:	Konstantin Khlebnikov <koct9i@...il.com>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	linux-mm <linux-mm@...ck.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Cyrill Gorcunov <gorcunov@...nvz.org>,
	Christian Borntraeger <borntraeger@...ibm.com>
Subject: Re: [PATCH] mm: enable RLIMIT_DATA by default with workaround for valgrind

On Sun, Apr 24, 2016 at 9:49 PM, Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
> On Sun, Apr 24, 2016 at 1:07 AM, Konstantin Khlebnikov <koct9i@...il.com> wrote:
>>
>> This patch checks current usage also against rlim_max if rlim_cur is zero.
>> Size of brk is still checked against rlim_cur, so this part is completely
>> compatible - zero rlim_cur forbids brk() but allows private mmap().
>
> The logic looks reasonable to me. My first reaction was that "but then
> any process can set the limit to zero, and actually increase limits",
> but witht he hard limit always being checked that's ok - the process
> could have just set the soft limit to the hard limit instead.
>
> The only part I don't like in that patch is the disgusting line breaking.
>
> Breaking lines in the middle of a comparison is just nasty and wrong.
> That code should have been written as
>
>         if (rlimit(RLIMIT_DATA) != 0)
>                 return false;
>         return mm->data_vm + npages <= rlimit_max(RLIMIT_DATA) >> PAGE_SHIFT;
>
> or something like that. Since you removed the pr_warn_once(), you
> should remove ignore_rlimit_data too.
>
> Alternatively, if you want to keep ignore_rlimit_data, then you should
> have kept the warning too. Making the actual rlimit data check an
> inline helper function and having the ignore_rlimit_data check (and
> printout) in the caller would make it pretty.

Ok, I'll keep boot option and warning. This should make transition less
painful. That data segment limit was almost useless for a long time and
now it actually starts working, I'm sure there are a lot of strange
configurations around it.

And I want to keep stuff in one function - this simplifies revert =)

>
> Because breaking lines in the middle of an actual expression is just
> completely wrong. It's much worse than having a long line.
>
> (The exception to that "middle of an expression" is breaking lines at
> logical expression boundaries: things like adding up several
> independent expressions, and having it be
>
>      sum = a +
>            b +
>            c;
>
> or be something like
>
>      if (a ||
>         b ||
>         c)
>             do_something():
>
> where 'a', 'b' and 'c' are complex but fairly independent expressions).
>
>                   Linus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ