Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp174824yba; Wed, 17 Apr 2019 22:24:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/taaMHjaLJbQ9Gq7Zs0Q00KoZ3gHp5s88WUy1T+kPTxZ+lrYVhfAh1x/fEOiAj+679g4L X-Received: by 2002:a63:7219:: with SMTP id n25mr1321551pgc.258.1555565091932; Wed, 17 Apr 2019 22:24:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555565091; cv=none; d=google.com; s=arc-20160816; b=xwzU9PhZIID4y8kCeUFZfN470NJQr7l+urIIeF2AH6wCQ6cmodMvJyD/TEwFaUNzvq +qFrg3BZrkmwzp8csLHRUcnw5pEo8CCb5XK+QJoc3N9abSuNJ1+swcmL98i2lA8Oynkt 2u8PyyRtU9OosW7/ckC83g69LfQ0AY3C2iuwMXbDGcZT48nYwX3jnYOf59Y25d0tZxBH ynk5p2/k+eOeF+doCCESTuUo2K8g8kmfHsZk/pmqBK2dkb755kGzTnuAiJV7NIcPkrGU So8pXztXMhu0Dx9KBPFrYI/BtRdNnXED94JZkU0BX7IKWWZrJA3dpR1c2/+JGcgUIZBl o7uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=Y2OrEfAfUzMlipsZCoQ+KrURIeLhMn3AxuhA5y5txtM=; b=Ek4RKudfpgCpCzUoL2HXEYFIKqjVm0/gzqABFNxxPbib9v1O7IMKkwukjBHDpWNvDj KWKvp2FTe+8mlOBfnXEYYzkgG13B3dzQ3VQS32SQjkrcCfeIQi98NCj90t+8lhlmGaHH 7+LsnWP6UAbkeyUiwKLkxhgBePRAslXaPZaFrs2UYpcAadxvka9FXn2DdDKta1pEs2ry 49G5XRRRJzapywEfMfjj36tb7CDOxWWaM3vvC9cBwJBIWgqNFlAXO4yxcbs53Ah/DvdE wTG7agla2/EDMnUlsYnH1+0hEvoSKcO27FZmSZ38lgzM3CAPbRb0aKaPJslWC7WTcle9 ++rw== 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 z8si922786pgu.217.2019.04.17.22.24.36; Wed, 17 Apr 2019 22:24:51 -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 S1731146AbfDRFXr (ORCPT + 99 others); Thu, 18 Apr 2019 01:23:47 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:33281 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725886AbfDRFXr (ORCPT ); Thu, 18 Apr 2019 01:23:47 -0400 X-Originating-IP: 79.86.19.127 Received: from [192.168.0.11] (127.19.86.79.rev.sfr.net [79.86.19.127]) (Authenticated sender: alex@ghiti.fr) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 2D76460003; Thu, 18 Apr 2019 05:23:38 +0000 (UTC) Subject: Re: [PATCH v3 02/11] arm64: Make use of is_compat_task instead of hardcoding this test To: Kees Cook Cc: Andrew Morton , Christoph Hellwig , Russell King , Catalin Marinas , Will Deacon , Ralf Baechle , Paul Burton , James Hogan , Palmer Dabbelt , Albert Ou , Alexander Viro , Luis Chamberlain , LKML , linux-arm-kernel , linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, "linux-fsdevel@vger.kernel.org" , Linux-MM References: <20190417052247.17809-1-alex@ghiti.fr> <20190417052247.17809-3-alex@ghiti.fr> From: Alex Ghiti Message-ID: <1f63cf5a-6bbe-fa55-75c0-20322d8a7f36@ghiti.fr> Date: Thu, 18 Apr 2019 01:23:38 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: sv-FI Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/18/19 12:32 AM, Kees Cook wrote: > On Wed, Apr 17, 2019 at 12:25 AM Alexandre Ghiti wrote: >> Each architecture has its own way to determine if a task is a compat task, >> by using is_compat_task in arch_mmap_rnd, it allows more genericity and >> then it prepares its moving to mm/. >> >> Signed-off-by: Alexandre Ghiti > Acked-by: Kees Cook Thanks ! > -Kees > >> --- >> arch/arm64/mm/mmap.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/arch/arm64/mm/mmap.c b/arch/arm64/mm/mmap.c >> index 842c8a5fcd53..ed4f9915f2b8 100644 >> --- a/arch/arm64/mm/mmap.c >> +++ b/arch/arm64/mm/mmap.c >> @@ -54,7 +54,7 @@ unsigned long arch_mmap_rnd(void) >> unsigned long rnd; >> >> #ifdef CONFIG_COMPAT >> - if (test_thread_flag(TIF_32BIT)) >> + if (is_compat_task()) >> rnd = get_random_long() & ((1UL << mmap_rnd_compat_bits) - 1); >> else >> #endif >> -- >> 2.20.1 >> >