From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 537F1C433E7 for ; Thu, 8 Oct 2020 17:23:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 81F7C221FF for ; Thu, 8 Oct 2020 17:23:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="bHwEU8Vz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 81F7C221FF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DC8F96B005D; Thu, 8 Oct 2020 13:23:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D52806B0062; Thu, 8 Oct 2020 13:23:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C40F46B0068; Thu, 8 Oct 2020 13:23:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0147.hostedemail.com [216.40.44.147]) by kanga.kvack.org (Postfix) with ESMTP id 931296B005D for ; Thu, 8 Oct 2020 13:23:09 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 31631181AE868 for ; Thu, 8 Oct 2020 17:23:09 +0000 (UTC) X-FDA: 77349428898.07.army52_3610aea271d9 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id 0A7321803F9A4 for ; Thu, 8 Oct 2020 17:23:09 +0000 (UTC) X-HE-Tag: army52_3610aea271d9 X-Filterd-Recvd-Size: 2789 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Thu, 8 Oct 2020 17:23:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=sTFqyXVXgvDGuEMygTQMR9pwPBQV4VgkgBJfdzUfbV4=; b=bHwEU8Vz+pghcLW/H8eaawNm4L mNdF8DL6q6KNYq153P8q0+z0dvaoQaXaPIjMj5+UehW9JUuju3vbmphUKjM61AphQN7/6idJbcTGy K3/98yOUGuLn1dlgHM350zkZjVX37/hlVdHfx11Tq02xql0ir0uT2s8PvjQAEooQ5oc/9EGrmFRJN w8t7eydC7myVfzozSkaDz2/NYGTt/c856AiB/5msvBmVp36Bds3yosoGrkqeZD3kf4lETAl8kNlNZ iB6lmcByFuLDVKnCIBPmJAwJU32S+5wMNO2WgnZW/3UImWCAW56LVTWPexeFCWgGO0a3Ukvfo5NAO fqAvaJ8A==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQZd6-0008Kh-Jj; Thu, 08 Oct 2020 17:23:00 +0000 Date: Thu, 8 Oct 2020 18:23:00 +0100 From: Matthew Wilcox To: Jann Horn Cc: Topi Miettinen , linux-hardening@vger.kernel.org, Andrew Morton , Linux-MM , kernel list Subject: Re: [PATCH RESEND v2] mm: Optional full ASLR for mmap() and mremap() Message-ID: <20201008172300.GL20115@casper.infradead.org> References: <20201008165408.38228-1-toiwoton@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Oct 08, 2020 at 07:13:51PM +0200, Jann Horn wrote: > You may want to consider whether it would be better to store > information about free memory per subtree in the VMA tree, together > with the maximum gap size that is already stored in each node, and > then walk down the tree randomly, with the randomness weighted by free > memory in the subtrees, but ignoring subtrees whose gaps are too > small. Please, no. We're trying to get rid of the rbtree, not enhance it further. The new data structure is a B-tree and we'd rather not burden it with extra per-node information (... although if we have to, we could) > And for expanding stacks, it might be a good idea for other > reasons as well (locking consistency) to refactor them such that the > size in the VMA tree corresponds to the maximum expansion of the stack > (and if an allocation is about to fail, shrink such stack mappings). We're doing that as part of the B-tree ;-) Although not the shrink stack mappings part ...