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]
Message-ID: <20151214153234.GE3604@chrystal.uk.oracle.com>
Date:	Mon, 14 Dec 2015 16:32:34 +0100
From:	Quentin Casasnovas <quentin.casasnovas@...cle.com>
To:	Cyrill Gorcunov <gorcunov@...il.com>
Cc:	Quentin Casasnovas <quentin.casasnovas@...cle.com>,
	linux-kernel@...r.kernel.org, linux-mm@...ck.org,
	Vegard Nossum <vegard.nossum@...cle.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Willy Tarreau <w@....eu>,
	Andy Lutomirski <luto@...capital.net>,
	Kees Cook <keescook@...gle.com>,
	Vladimir Davydov <vdavydov@...tuozzo.com>,
	Konstantin Khlebnikov <koct9i@...il.com>,
	Pavel Emelyanov <xemul@...tuozzo.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: Re: [RFC 1/2] [RFC] mm: Account anon mappings as RLIMIT_DATA

On Mon, Dec 14, 2015 at 06:11:16PM +0300, Cyrill Gorcunov wrote:
> On Mon, Dec 14, 2015 at 03:51:26PM +0100, Quentin Casasnovas wrote:
> ...
> > 
> > Do we want to fold may_expand_anon_vm() into may_expand_vm() (potentially
> > passing it the flags/struct file if needed) so there is just one such
> > helper function?  Rationale being that it then gets hard to see what
> > restricts what, and it's easy to miss one place.
> 
> I tried to make the patch small as possible (because otherwise indeed
> I would have to pass @vm_file|@...e as additional argument). This won't
> be a problem but may_expand_vm is called way more times than
> may_expand_anon_vm. That's the only rationale I followed.
>
> > For example, I couldn't find anything preventing a user to
> > mmap(MAP_GROWSDOWN) and uses that as a base to get pages that would not be
> > accounted for in your patch (making it a poor-man mremap()).
> 
> growsup/down stand for stack usage iirc, so it was intentionally
> not accounted here.
>

Right, but in the same vein of Linus saying RLIMIT_DATA is/was useless
because everyone could use mmap() instead of brk() to get anonymous memory,
what's the point of restricting "almost-all" anonymous memory if one can
just use MAP_GROWSDOWN/UP and cause repeated page faults to extend that
mapping, circumventing your checks?  That makes the new restriction as
useless as what RLIMIT_DATA used to be, doesn't it?

> > 
> > I only had a quick look so apologies if this is handled and I missed it :)
> 
> thanks for feedback! also take a look on Kostya's patch, I think it's
> even better approach (and I like it more than mine).

Ha I'm not subscribed to LKML so I missed those, I suppose you can ignore
my comments then! :)

Quentin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ