Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1449129pxu; Thu, 8 Oct 2020 11:43:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6K1SZr7bqZ8Nf1DpSZm6z6arynwGBvB6etHciOc2+Ta9N2BuxBAYmlpMFfp0KlKIQAMDc X-Received: by 2002:aa7:dc12:: with SMTP id b18mr10413627edu.295.1602182618972; Thu, 08 Oct 2020 11:43:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602182618; cv=none; d=google.com; s=arc-20160816; b=QhuDn/EyK1Y6YTs0jmrZ8VgV7MH7wNvy9SbZxD6Ae+FT57WV9wlAPEjNDlzvZGz2X1 9R7WNydK15eC7x6mHu/JUccV98PoqN0g1OQ9UlgW/ESO3IJ/Wgbei7ebuwMpah9hH5xR 60A2fT3iNJNf7Y8ljoei3stgqGVT6vkZyH6+E/EbyZyL0iH1r+KcVzE2bqmdn/5P+KIF K2zxwZes4pU7xQutVkVRcsxO0wdWHQjjv4w4JEvm6524eUXsweQ8bNwEuubwTZON3kq7 2x7PGAp0DgownvIJewLfW90f15zlg8Cf33MVDc5MIxadUGaKKGz3YDnIUpRGp8rxXkmQ 06NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=sTFqyXVXgvDGuEMygTQMR9pwPBQV4VgkgBJfdzUfbV4=; b=TwDFGoRVprVNcUQ7cbnF13Cl1LuR0LTffdT3H9heMIiNdMT+edLhneMOEODPEo6rw8 kfGCFUtaN/djK5BNK+SRK5IwCd1wZalt+QPJ/T9J/0AwIRVTgUrseZgT8kRYNTwHGqte yXaIFzpZ53PSBbPIX59hTBjP1DdFlJVSnGmfUEopOYIUAH/8Z6g0GA9uMJ0flOSiyfgM 1gIKBcJxYF2AT9OwUDANPAs2PhNH2OdP8wFaC4H+nmMI9DO5ZQoI3LFpLc9wgNQICjTx TXhYKebO9bOOvfeaUvw7aa9y4NDz12ztJBvUsIu7amEXkDphn0tH4UgqsO9BbA9eGsiE firA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=bHwEU8Vz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cf16si3832524edb.540.2020.10.08.11.43.14; Thu, 08 Oct 2020 11:43:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=bHwEU8Vz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732012AbgJHRXG (ORCPT + 99 others); Thu, 8 Oct 2020 13:23:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729476AbgJHRXD (ORCPT ); Thu, 8 Oct 2020 13:23:03 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4922BC061755; Thu, 8 Oct 2020 10:23:03 -0700 (PDT) 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ...