Received: by 10.223.185.116 with SMTP id b49csp6509391wrg; Wed, 28 Feb 2018 10:34:59 -0800 (PST) X-Google-Smtp-Source: AH8x224iHbJK4dvnHHqfizOSo3+y+j78P1Tg/8q4xSs7fhT0R1Mf4tmnY8zjoISwgxA0aci0fkws X-Received: by 10.98.21.200 with SMTP id 191mr17851809pfv.166.1519842899693; Wed, 28 Feb 2018 10:34:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519842899; cv=none; d=google.com; s=arc-20160816; b=OkpXUFkb7BqXaTQ0aPJed93WQVJ6+1Z5cy2BCnNdzNmG4HqOWsgpvlhTk+g1/EdZPf uLowka44gkVT2A/s5QIsofVN6uRns7S+YfDa7p6rF8MYvJK8PlpSBlzJvnPTF6Ts5AHI 42DEbCOQTFuJ0+BgZmro0Evvd0RJWtfmzIqxEhKjnzg1Wgtv1KWaCJVLmzDRd3MiHpbg 50yUk6K3c+8pg7VkXxZMa3kEvvNQUBQQ55ysd1OtFVTMTQsm7j1LKubaF9bkGAJf1Bz0 g5I/9m7ueqE9nNRCK8pNLs/pDiPGvCwnNAuEA8D+WvcGYHiNDSivt4h34bOaYiCYeZaV Tr3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=g8SX4SLi4RkiFOdy8Mlxeym76W4/EErheyMzRMrdrys=; b=pcZCQhoqSW+4IaJ9BnNSm4WAjB2xlIPdhxI/BKswQd+flLP+S+X5EUp0cHZ23OOEe8 mN/eqwa8+7Ublsht/pnYR9NbjAOsHsTY6zZV8RGY4rdOadI8Yp06I6NMdFGJvkPZz4vO eoowOf4W//mml8K4M5FYIvUXv9Q7ooe6zyM3/dQX4UIIJskDPjxuLDR7d9ZLuITq5VQx cvQXaE9fUaraxWWs+bvePw3cBhJZPbl2g8yOS75f4tm+clQnsx9F1FuQCp1ltKEktAKH ZZ5a8WG+2QYOOekKoiVnvvvPEUWGZN3K9CRB91hf2CbFz34BTFtpUlPOKV78PVf7FC2X u9BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Q0aCEXj/; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v11si1306711pgr.172.2018.02.28.10.34.44; Wed, 28 Feb 2018 10:34:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Q0aCEXj/; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932670AbeB1Sd6 (ORCPT + 99 others); Wed, 28 Feb 2018 13:33:58 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:45314 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932300AbeB1Sd5 (ORCPT ); Wed, 28 Feb 2018 13:33:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=g8SX4SLi4RkiFOdy8Mlxeym76W4/EErheyMzRMrdrys=; b=Q0aCEXj/11WW9e6YuupF0Oht5L qGdL55crfpeU7GtxQZrOaoeWOP18QIJ0RL9A9Fyv7p3u7d6SpK8ULMM8a5qILxEO/B+KEpGcLKIGI BhpwCmKpdCS++rNFpMNNzJUeOZFMTvaimq2P8yfp0MpwmllsJuncRXE9h7z1PUuLfbX62EYRa/OKC iv67EK5LNROX3rE3EDYL0L+Bls/1EMDQ94Ly5puNjVHKGwh7LraP8AIXqljxh7wCtuWOxdM77X/iU MBTNC2sqfwY1RU4cA5LN1lyKy3/UvygXpYbQ0QpZepfja/ByUnM4eTciBrTVPR1maPvd28e27EeYx ff3+rSrQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.89 #1 (Red Hat Linux)) id 1er6Y2-0007ep-6U; Wed, 28 Feb 2018 18:33:50 +0000 Date: Wed, 28 Feb 2018 10:33:49 -0800 From: Matthew Wilcox To: Ilya Smith Cc: Kees Cook , Andrew Morton , Dan Williams , Michal Hocko , "Kirill A. Shutemov" , Jan Kara , Jerome Glisse , Hugh Dickins , Helge Deller , Andrea Arcangeli , Oleg Nesterov , Linux-MM , LKML , Kernel Hardening Subject: Re: [RFC PATCH] Randomization of address chosen by mmap. Message-ID: <20180228183349.GA16336@bombadil.infradead.org> References: <20180227131338.3699-1-blackzert@gmail.com> <55C92196-5398-4C19-B7A7-6C122CD78F32@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <55C92196-5398-4C19-B7A7-6C122CD78F32@gmail.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 28, 2018 at 08:13:00PM +0300, Ilya Smith wrote: > > It would be worth spelling out the "not recommended" bit some more > > too: this fragments the mmap space, which has some serious issues on > > smaller address spaces if you get into a situation where you cannot > > allocate a hole large enough between the other allocations. > > > > I’m agree, that's the point. Would it be worth randomising the address returned just ever so slightly? ie instead of allocating exactly the next address, put in a guard hole of (configurable, by default maybe) 1-15 pages? Is that enough extra entropy to foil an interesting number of attacks, or do we need the full randomise-the-address-space approach in order to be useful?