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.8 required=3.0 tests=BAYES_00, 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 B4481C4167B for ; Thu, 3 Dec 2020 23:16:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 188FA224B1 for ; Thu, 3 Dec 2020 23:16:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 188FA224B1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=ACULAB.COM Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D8BAB6B0036; Thu, 3 Dec 2020 18:16:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D60FA6B005C; Thu, 3 Dec 2020 18:16:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C29AF6B0068; Thu, 3 Dec 2020 18:16:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0066.hostedemail.com [216.40.44.66]) by kanga.kvack.org (Postfix) with ESMTP id ADFFE6B0036 for ; Thu, 3 Dec 2020 18:16:04 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 6CF608249980 for ; Thu, 3 Dec 2020 23:16:04 +0000 (UTC) X-FDA: 77553531048.14.sheet99_3a0fcde273bf Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin14.hostedemail.com (Postfix) with ESMTP id 431CB1822987B for ; Thu, 3 Dec 2020 23:16:04 +0000 (UTC) X-HE-Tag: sheet99_3a0fcde273bf X-Filterd-Recvd-Size: 3264 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [207.82.80.151]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Thu, 3 Dec 2020 23:16:03 +0000 (UTC) Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-74-ZN_hijpIMCiOzkEhiip_Rg-1; Thu, 03 Dec 2020 23:16:00 +0000 X-MC-Unique: ZN_hijpIMCiOzkEhiip_Rg-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Thu, 3 Dec 2020 23:15:59 +0000 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Thu, 3 Dec 2020 23:15:59 +0000 From: David Laight To: 'Mike Rapoport' , Topi Miettinen CC: "linux-hardening@vger.kernel.org" , "akpm@linux-foundation.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Andy Lutomirski , Jann Horn , Kees Cook , Linux API , Matthew Wilcox Subject: RE: [PATCH] mm/vmalloc: randomize vmalloc() allocations Thread-Topic: [PATCH] mm/vmalloc: randomize vmalloc() allocations Thread-Index: AQHWyUIaOaq71c1O10ObeOeJDE6bhanmALEg Date: Thu, 3 Dec 2020 23:15:59 +0000 Message-ID: <2a672ff3df0c47538ed7d1974c864f0b@AcuMS.aculab.com> References: <20201201214547.9721-1-toiwoton@gmail.com> <9d34fb0a-7aba-1e84-6426-006ea7c3d9f5@gmail.com> <20201203065801.GH751215@kernel.org> In-Reply-To: <20201203065801.GH751215@kernel.org> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: From: Mike Rapoport > Sent: 03 December 2020 06:58 >=20 > On Wed, Dec 02, 2020 at 08:49:06PM +0200, Topi Miettinen wrote: > > On 1.12.2020 23.45, Topi Miettinen wrote: > > > Memory mappings inside kernel allocated with vmalloc() are in > > > predictable order and packed tightly toward the low addresses. With > > > new kernel boot parameter 'randomize_vmalloc=3D1', the entire area is > > > used randomly to make the allocations less predictable and harder to > > > guess for attackers. Isn't that going to horribly fragment the available address space and make even moderate sized allocation requests fail (or sleep). I'm not even sure that you need to use 'best fit' rather than 'first fit'. 'best fit' is certainly a lot better for a simple linked list user space malloc. =09David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1= PT, UK Registration No: 1397386 (Wales)