Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2148201yba; Fri, 19 Apr 2019 13:07:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqz0p3SjcUAMmPojd5DOB8i+HWteCoT0LXEpzDHhHcJgdQI+aePu4p84xMeETx1Ch6VDJ9sk X-Received: by 2002:a62:cfc4:: with SMTP id b187mr5902241pfg.130.1555704478457; Fri, 19 Apr 2019 13:07:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555704478; cv=none; d=google.com; s=arc-20160816; b=oA1u4vMQ6/eFv/UlDbis5HhGF88jQRCoSkdLEM3abCdzD36HWJ1u/EAxIPfn1gWiBb 3iejSl1XFl/UVM5TqjfQ0csIjcAErmBbB7TBGd2a+TaSdz705c1Cj37RCl432ak1CwBL ucGqnDoFLrYGg7ouDhKW8EkBMuhn+bRkfNnDhF3hEIAFt/rouKf9WICOXF/iPTD7ox/3 fVdlbAVA3ShRTPuZma3R31brdV3Et31NNQPRZYlkfMPw6VIsI+uWYoeJA40p5TQWNXHW 6v8lUotSB5GClLo37qFXe3mleQSPMNvJC6X+UA7nSrn0lpUfTb2BpPlv88RkUr7AigGA 8Giw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:subject:from; bh=pLbKEWX3KLQG4g9IcO72nGPPB8USEyEFpeVB06WUSPY=; b=vQqX1ANv2MNke5udMY4WXgePgQHFrL/64w8wdYvcnK0fQMs7SkjCAgJPDTkWWiDhQD Pld7+5AqAmg7KPMzxmj3GMBBf4/ZVCvge86uxm1py36l7sYkUI0Y1bBdYHvqygax2gFt qr1o5k68tN8JiyUJy8SV/wyMEuBqdgjjrfqya1KeEu46OJAE4JWeGm9X9Pguy37AGJJQ zdGAsJxUBXUrr6T2kFbEr5yMwnwlum3ImV6ecEDT9dB2m6BLLXiJSm2B0OWsswNCEbnM cFSCuRXz5O3PyQQ1xhSgcANWx7RssCxkk/YvbC4i71kd1iWaVRDn2W3scxvXs8Pbg8dL LxvA== ARC-Authentication-Results: i=1; mx.google.com; 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 n1si5421659pgj.578.2019.04.19.13.07.42; Fri, 19 Apr 2019 13:07:58 -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; 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 S1728199AbfDSUGd (ORCPT + 99 others); Fri, 19 Apr 2019 16:06:33 -0400 Received: from mslow2.mail.gandi.net ([217.70.178.242]:56286 "EHLO mslow2.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726928AbfDSUGc (ORCPT ); Fri, 19 Apr 2019 16:06:32 -0400 Received: from relay10.mail.gandi.net (unknown [217.70.178.230]) by mslow2.mail.gandi.net (Postfix) with ESMTP id BC2DE3A37FE; Fri, 19 Apr 2019 07:22:12 +0000 (UTC) Received: from [10.30.1.20] (lneuilly-657-1-5-103.w81-250.abo.wanadoo.fr [81.250.144.103]) (Authenticated sender: alex@ghiti.fr) by relay10.mail.gandi.net (Postfix) with ESMTPSA id F1A80240006; Fri, 19 Apr 2019 07:21:51 +0000 (UTC) From: Alex Ghiti Subject: Re: [PATCH v3 04/11] arm64, mm: Move generic mmap layout functions to mm To: Kees Cook Cc: Albert Ou , Catalin Marinas , Palmer Dabbelt , Will Deacon , Russell King , Ralf Baechle , LKML , Christoph Hellwig , Linux-MM , Paul Burton , linux-riscv@lists.infradead.org, Alexander Viro , James Hogan , "linux-fsdevel@vger.kernel.org" , Andrew Morton , linux-mips@vger.kernel.org, Christoph Hellwig , linux-arm-kernel , Luis Chamberlain References: <20190417052247.17809-1-alex@ghiti.fr> <20190417052247.17809-5-alex@ghiti.fr> Message-ID: <365fe520-b14a-c792-9961-c18f79edfe13@ghiti.fr> Date: Fri, 19 Apr 2019 09:20:36 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: fr Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/18/19 10:19 AM, Kees Cook wrote: > On Thu, Apr 18, 2019 at 12:55 AM Alex Ghiti wrote: >> Regarding the help text, I agree that it does not seem to be frequent to >> place >> comment above config like that, I'll let Christoph and you decide what's >> best. And I'll >> add the possibility for the arch to define its own STACK_RND_MASK. > Yeah, I think it's very helpful to spell out the requirements for new > architectures with these kinds of features in the help text (see > SECCOMP_FILTER for example). > >>> I think CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT should select >>> CONFIG_ARCH_HAS_ELF_RANDOMIZE. It would mean moving >> >> I don't think we should link those 2 features together: an architecture >> may want >> topdown mmap and don't care about randomization right ? > Given that the mmap randomization and stack randomization are already > coming along for the ride, it seems weird to make brk randomization an > optional feature (especially since all the of the architectures you're > converting include it). I'd also like these kinds of security features > to be available by default. So, I think one patch to adjust the MIPS > brk randomization entropy and then you can just include it in this > move. Ok that makes sense, and that would bring support for randomization to riscv at the same time, so I'll look into it, thanks. >> Actually, I had to add those ifdefs for mmap_rnd_compat_bits, not >> is_compat_task. > Oh! In that case, use CONFIG_HAVE_ARCH_MMAP_RND_BITS. :) Actually, > what would be maybe cleaner would be to add mmap_rnd_bits_min/max > consts set to 0 for the non-CONFIG_HAVE_ARCH_MMAP_RND_BITS case at the > top of mm/mmap.c. Ok I'll do that. > > I really like this clean-up! I think we can move x86 to it too without > too much pain. :) > Yeah I think too, I will do that too. Thanks again, Alex