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=-7.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=unavailable 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 98564C10F0B for ; Thu, 18 Apr 2019 04:32:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 658CA2184B for ; Thu, 18 Apr 2019 04:32:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="BwFdgFLF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726423AbfDREcg (ORCPT ); Thu, 18 Apr 2019 00:32:36 -0400 Received: from mail-ua1-f66.google.com ([209.85.222.66]:41297 "EHLO mail-ua1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725987AbfDREcf (ORCPT ); Thu, 18 Apr 2019 00:32:35 -0400 Received: by mail-ua1-f66.google.com with SMTP id l22so346995uao.8 for ; Wed, 17 Apr 2019 21:32:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=emqG7/19kpW5wZ57vs/jCWwiZdoRZXGDohb1D974Avc=; b=BwFdgFLFNee7q4d/odil7gkB/UOuVM/QIlnvE7TGVcPxV0znLQ4z7fs87fH9FD/p2Q QIWn2YByOZWf2cz5EWUgLnTt8H1YHdlzqE3vWASVSstFIxPSA4Jhvnkwf4hkz5pNBDia 3hMlCG7M0QDEQlArREt5/8jUB1Ed/r+jW9qXM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=emqG7/19kpW5wZ57vs/jCWwiZdoRZXGDohb1D974Avc=; b=IkfLP4h9RTzbYmbtVUwNXSrDDfd2koEn1NEgp9/f6jmHXmiKtTxovbEcSo168Bcydm jyxMisjpzFUXTKHrWt9qzkoMkWPXQNXBspxydwMiN5h+vZwBeTd/WbIxjvklPW1gLLzg VmwL0uG7t8/LOmiqwg6+3yfBVE74QnGnK1g4KsQq910JhvOz1j2n8/yO9r8wTQyvSwtp fRKnyR8DNHEqqTzVuVHo0Bs14DIU67mKxaQiSV4yqP8x+e625y2uAXFQhLJA3zq0w4xT 32/RUv5Xp6ywfuq8Dj6IKjlMWqrDY+6Etiq0jt4AiDRYvOmrBXopNPZvFi2XXl4yKn63 Vh9Q== X-Gm-Message-State: APjAAAUUcPOZM2HhN+zO1Sc3+j0TVTAmcUuCQ8OCcduwK0oHgqk2D3w6 B2K5OJ/fCzQxgcETTEt/kXMdtoKCxM0= X-Google-Smtp-Source: APXvYqzVMR9UOETiD9XPwm/OBiFrlCDaMPPRm2UQ18Di/n7gf4w9XHMU6neytc1Pv2EKhQiLl354hA== X-Received: by 2002:ab0:6419:: with SMTP id x25mr40938503uao.86.1555561954035; Wed, 17 Apr 2019 21:32:34 -0700 (PDT) Received: from mail-vs1-f50.google.com (mail-vs1-f50.google.com. [209.85.217.50]) by smtp.gmail.com with ESMTPSA id a26sm128982vsq.29.2019.04.17.21.32.29 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Wed, 17 Apr 2019 21:32:30 -0700 (PDT) Received: by mail-vs1-f50.google.com with SMTP id w13so456636vsc.4 for ; Wed, 17 Apr 2019 21:32:29 -0700 (PDT) X-Received: by 2002:a67:bc13:: with SMTP id t19mr2517845vsn.222.1555561949440; Wed, 17 Apr 2019 21:32:29 -0700 (PDT) MIME-Version: 1.0 References: <20190417052247.17809-1-alex@ghiti.fr> <20190417052247.17809-3-alex@ghiti.fr> In-Reply-To: <20190417052247.17809-3-alex@ghiti.fr> From: Kees Cook Date: Wed, 17 Apr 2019 23:32:17 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 02/11] arm64: Make use of is_compat_task instead of hardcoding this test To: Alexandre Ghiti 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 , Kees Cook , LKML , linux-arm-kernel , linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, "linux-fsdevel@vger.kernel.org" , Linux-MM Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org 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 -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 > -- Kees Cook