linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Blaisorblade <blaisorblade@yahoo.it>
To: Hugh Dickins <hugh@veritas.com>, Rik van Riel <riel@redhat.com>
Cc: Andrew Morton <akpm@osdl.org>,
	LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>
Subject: Remap_file_pages, RSS limits, security implications (was: Re: [uml-devel] Re: [RFC] [patch 0/18] remap_file_pages protection support (for UML), try 3)
Date: Tue, 20 Sep 2005 17:06:05 +0200	[thread overview]
Message-ID: <200509201706.06852.blaisorblade@yahoo.it> (raw)
In-Reply-To: <Pine.LNX.4.61.0509071259380.17612@goblin.wat.veritas.com>

On Wednesday 07 September 2005 14:00, Hugh Dickins wrote:
> On Sun, 4 Sep 2005, Blaisorblade wrote:
> > On Friday 02 September 2005 23:02, Hugh Dickins wrote:
> > > On Fri, 26 Aug 2005, Blaisorblade wrote:
> > > > Subject: [patch 06/18] remap_file_pages protection support: support
> > > > private vma for MAP_POPULATE

> > > [...]
> > > you're just letting private maps
> > > be populated linearly, that's fine.

> > Would that be a real problem, when limited to readonly mappings?

> Regarding nonlinear readonly.  I never asked Ingo why he excluded it -
> suspect he didn't intend to, but missed the peculiar treatment of VM_SHARED
> versus VM_MAYSHARE - my apologies, Ingo, if I'm underestimating you!
Ahh, ok... VM_MAYSHARE is the recorded MAP_SHARED, while VM_SHARED says 
whether the pages are actually shared and writable.
> But 
> I was glad he had because it demands write access to the file being mapped
> nonlinear.  Therefore the ordinary user cannot map libc.so nonlinear, and
> condemn all users to the sledgehammer fashion of try_to_unmap_cluster.

> Though thinking through that again now, the user of the nonlinear vma
> is penalized,

Where? Not in the page fault path.... it's as penalized as the rest of the 
system. Or will direct reclaim have a preference for pages of the calling 
process?
> and the whole system is penalized by the difficulty in 
> reclaiming efficiently, but I don't see the other users of the library
> particularly penalized (they might be unfairly advantaged by having its
> pages stay unnaturally long in memory).
Those pages would be either needed (and wouldn't be swapped anyway) or 
unneeded (and thus they'd waste memory).

But the waste is possible even currently. If not having rmap were a local DoS, 
well, an unprivileged user may well mmap and remap nonlinearly some really 
big files.

So, it would really be better to actually enforce the RSS rlimit when mapping 
in pages in *nonlinear* areas (and fallback on setting file PTE's like on 
NONBLOCK & page not in cache), rather than the "current" Rik's idea of 
marking pages as inactive on memory-hog processes.

But oh, right in mm/trash.c, the code which should do part of this is fully 
commented out - and it was in the very first version of the code (looking 
through bkcvs-git repository).

And the RLIMIT_RSS is totally unused - I bet Rik's patch didn't manage to go 
in, or it's me missing something?
> Either I was wrong before, or 
> I'm missing another aspect of it now: I don't know which.

-- 
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade


	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it

  parent reply	other threads:[~2005-09-20 18:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-26 18:23 [RFC] [patch 0/18] remap_file_pages protection support (for UML), try 3 Blaisorblade
2005-08-26 19:11 ` Hugh Dickins
2005-08-26 19:58   ` [uml-devel] " Blaisorblade
2005-09-02 21:02 ` Hugh Dickins
2005-09-04 19:10   ` [uml-devel] " Blaisorblade
2005-09-07 12:00     ` Hugh Dickins
2005-09-13 18:25       ` Blaisorblade
2005-09-20 15:06       ` Blaisorblade [this message]
2005-09-20 18:23         ` Remap_file_pages, RSS limits, security implications (was: Re: [uml-devel] Re: [RFC] [patch 0/18] remap_file_pages protection support (for UML), try 3) Rik van Riel
2005-09-21 15:16         ` Hugh Dickins
2005-09-21 16:16           ` Blaisorblade
2005-09-21 16:50             ` Hugh Dickins
2005-09-21 17:02               ` Blaisorblade
2005-09-26 15:58       ` [uml-devel] Re: [RFC] [patch 0/18] remap_file_pages protection support (for UML), try 3 Blaisorblade
2005-09-28 13:37         ` Hugh Dickins
2005-09-28 16:20           ` Blaisorblade

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200509201706.06852.blaisorblade@yahoo.it \
    --to=blaisorblade@yahoo.it \
    --cc=akpm@osdl.org \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=riel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).