From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f197.google.com (mail-wr0-f197.google.com [209.85.128.197]) by kanga.kvack.org (Postfix) with ESMTP id E40C36B0005 for ; Thu, 8 Feb 2018 23:26:13 -0500 (EST) Received: by mail-wr0-f197.google.com with SMTP id 73so3836858wrb.13 for ; Thu, 08 Feb 2018 20:26:13 -0800 (PST) Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id l57sor860330edd.30.2018.02.08.20.26.12 for (Google Transport Security); Thu, 08 Feb 2018 20:26:12 -0800 (PST) Date: Fri, 9 Feb 2018 07:26:09 +0300 From: "Kirill A. Shutemov" Subject: Re: [RFC] Limit mappings to ten per page per process Message-ID: <20180209042609.wi6zho24wmmdkg6i@node.shutemov.name> References: <20180208021112.GB14918@bombadil.infradead.org> <20180208185648.GB9524@bombadil.infradead.org> <20180208194235.GA3424@bombadil.infradead.org> <20180208202100.GB3424@bombadil.infradead.org> <20180208213743.GC3424@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180208213743.GC3424@bombadil.infradead.org> Sender: owner-linux-mm@kvack.org List-ID: To: Matthew Wilcox Cc: Daniel Micay , Jann Horn , linux-mm@kvack.org, Kernel Hardening , kernel list , "Kirill A. Shutemov" On Thu, Feb 08, 2018 at 01:37:43PM -0800, Matthew Wilcox wrote: > On Thu, Feb 08, 2018 at 12:21:00PM -0800, Matthew Wilcox wrote: > > Now that I think about it, though, perhaps the simplest solution is not > > to worry about checking whether _mapcount has saturated, and instead when > > adding a new mmap, check whether this task already has it mapped 10 times. > > If so, refuse the mapping. > > That turns out to be quite easy. Comments on this approach? This *may* break some remap_file_pages() users. And it may be rather costly for popular binaries. Consider libc.so. -- Kirill A. Shutemov -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org