Date: Fri, 2 Mar 2018 12:48:08 -0800 From: Matthew Wilcox Subject: Re: [RFC PATCH] Randomization of address chosen by mmap. Message-ID: <20180302204808.GA671@bombadil.infradead.org> References: <20180227131338.3699-1-blackzert@gmail.com> <55C92196-5398-4C19-B7A7-6C122CD78F32@gmail.com> <20180228183349.GA16336@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 List-ID: On Fri, Mar 02, 2018 at 11:30:28PM +0300, Ilya Smith wrote: > This is a really good question. Lets think we choose address with random-length > guard hole. This length is limited by some configuration as you described. For > instance let it be 1MB. Now according to current implementation, we still may > fill this gap with small allocations with size less than 1MB. Attacker will > going to build attack base on this predictable behaviour - he jus need to spray > with 1 MB chunks (or less, with some expectation). This attack harder but not > impossible. Ah, I didn't mean that. I was thinking that we can change the implementation to reserve 1-N pages after the end of the mapping. So you can't map anything else in there, and any load/store into that region will segfault.