Received: by 10.213.65.68 with SMTP id h4csp338227imn; Fri, 23 Mar 2018 05:52:59 -0700 (PDT) X-Google-Smtp-Source: AG47ELv/DO/8LOsrFb2ZsuLt0fdsUuGgNtPt9kCF0xBhA9mTsIA6UuhYYiprujYEIbZHuQ+wJXo9 X-Received: by 2002:a17:902:274a:: with SMTP id j10-v6mr7238955plg.28.1521809579170; Fri, 23 Mar 2018 05:52:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521809579; cv=none; d=google.com; s=arc-20160816; b=YCyGZVzvv5YKr9JREzjd7aTIiwt03eINjwole30bShvI1zngAYvD9g5ZOiIuG7XxLK 2OrDtZWUDzPC4o/ZsWEtvDEK9DY8kNqQXEl0w9Puyh8Bba4swlWjZCrOJavTcEeTpR0F dLV576EddohKYl0vHGcu9IQBVpFF9zpqhgssHwQDMV3IC8ApdPFmgKWzSjzodSpao6cS S1fzytHiL/ccNUwi/9RRR3PnP0gu9Ug0bGLn8LWWPL+cBgwO0GnJqf/Asq79e3rbDdoe Cr8xRJEdvWTZ6tM6vuhfF6MG6sMs1WVJmV3g8Ix+OU1DWGw1dpOLdGMmnX9FHLmVEJgj w5LA== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=7orINHI4+601Ya7KgoqsfTTqu+zqpdOM8kMSG4cJqJ4=; b=ddbC+2SUzX9hDzFcs2xEnKRBFcshtSp8tmmcjWnxdXeMbgbYzEJHGb9ntttQX3+J/K 8IdfmsD+qJfX7lwGgpn2yVr2FyBKDWK50PtFrzE1ihakx1toevIhDwlK8qFMZgi/x1V9 oxCpBnOd3rUrFmHtDFwfXRw+308B8iWCPXW7d1TlUrtnGO05r+6RE+CcWVbgJmhW3kE/ X74LQ4L2eU1icw0p+X8X6pfEvd2rk/6lPANnjKP89LuhYzKqtnz4CsQ1aXyTAqEV3D5w qc6uQs5zB4iMbIMeFq4d60l/iMFjLQt8idANQYtMpIFOcFWOdrcG+ONvX+qQvDofdeWM 1xjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=XGcfqtIq; 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 i8si6063283pgt.279.2018.03.23.05.52.44; Fri, 23 Mar 2018 05:52:59 -0700 (PDT) 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=XGcfqtIq; 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 S1752708AbeCWMtp (ORCPT + 99 others); Fri, 23 Mar 2018 08:49:45 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:44034 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752087AbeCWMtl (ORCPT ); Fri, 23 Mar 2018 08:49:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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: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=7orINHI4+601Ya7KgoqsfTTqu+zqpdOM8kMSG4cJqJ4=; b=XGcfqtIqYEF0mTGJXW/En1OK2 pvAiQiWtkUR7ZEzjkVdqB+GEcsHT5OxCOaCJNSuX922S0kqVD15UiPtIJhofIN2zNJEia+8VwF0IM YH4ihePwzXe+l2bNkQusG4ABKIUYg/kgvTA4fmI3EgjWGbKhT9qeytZ83dR/g5jR3k0sY4r/oWZAw CuIGD+YBm9gUyquiyK4yWZrJy8UnTCBKkoO8PIptU/KXmGiVb338A1DXauJxcfvcG4NaKpFVMe8HQ qQZr+TyFVbacqzYBHDdqCEhtx+lLSgMaEA7m1LbVJh1eeL3Cx2JbXNl0orzIa7BHQM35C2hOf/uID vDSEv0Yvw==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1ezM74-0002Ab-VV; Fri, 23 Mar 2018 12:48:06 +0000 Date: Fri, 23 Mar 2018 05:48:06 -0700 From: Matthew Wilcox To: Ilya Smith Cc: rth@twiddle.net, ink@jurassic.park.msu.ru, mattst88@gmail.com, vgupta@synopsys.com, linux@armlinux.org.uk, tony.luck@intel.com, fenghua.yu@intel.com, jhogan@kernel.org, ralf@linux-mips.org, jejb@parisc-linux.org, deller@gmx.de, benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, ysato@users.sourceforge.jp, dalias@libc.org, davem@davemloft.net, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, nyc@holomorphy.com, viro@zeniv.linux.org.uk, arnd@arndb.de, gregkh@linuxfoundation.org, deepa.kernel@gmail.com, mhocko@suse.com, hughd@google.com, kstewart@linuxfoundation.org, pombredanne@nexb.com, akpm@linux-foundation.org, steve.capper@arm.com, punit.agrawal@arm.com, paul.burton@mips.com, aneesh.kumar@linux.vnet.ibm.com, npiggin@gmail.com, keescook@chromium.org, bhsharma@redhat.com, riel@redhat.com, nitin.m.gupta@oracle.com, kirill.shutemov@linux.intel.com, dan.j.williams@intel.com, jack@suse.cz, ross.zwisler@linux.intel.com, jglisse@redhat.com, aarcange@redhat.com, oleg@redhat.com, linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-metag@vger.kernel.org, linux-mips@linux-mips.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-mm@kvack.org Subject: Re: [RFC PATCH v2 0/2] Randomization of address chosen by mmap. Message-ID: <20180323124806.GA5624@bombadil.infradead.org> References: <1521736598-12812-1-git-send-email-blackzert@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1521736598-12812-1-git-send-email-blackzert@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 Thu, Mar 22, 2018 at 07:36:36PM +0300, Ilya Smith wrote: > Current implementation doesn't randomize address returned by mmap. > All the entropy ends with choosing mmap_base_addr at the process > creation. After that mmap build very predictable layout of address > space. It allows to bypass ASLR in many cases. This patch make > randomization of address on any mmap call. Why should this be done in the kernel rather than libc? libc is perfectly capable of specifying random numbers in the first argument of mmap.