Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp139878yba; Wed, 17 Apr 2019 21:33:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHdx0GDYXQLWifSXbh74NiqfvCgZk62UI8neZ9kqHC9Sle3KqbPdjhTZZ8LuY4G6khwNhJ X-Received: by 2002:aa7:8c84:: with SMTP id p4mr94771807pfd.164.1555562019070; Wed, 17 Apr 2019 21:33:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555562019; cv=none; d=google.com; s=arc-20160816; b=MMrTAMBeCLYxCaS/9zzOCwSy6Wty3gJVZQmjanP9n6O60n8EU3derd1Z46yjunSz18 pOiSn1anshVN7uWfDq/ouhCzR5Iutm8m9DOE6EZ1B9/HAZTxs+7067M48YT45fuVLi3n tgqmhuH7iOznD1usbpZ6kMeD6KzFb1I6Bc1/8jmEIhMeM7jU9WAqfGzIz13BJX512xlt 0XirDoPOd5uJI/B5z4Og+CLn0uaHZrMaGjSt+JElBoysrACdlaSzM4FLiEXfuAR5xLEM hOTe8uUFdwYy3RBhqPcmmI3wECOLXpV6cxVB9h971RCOkmxJUwsaKxYWECjLhGMcTCU2 ztwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=emqG7/19kpW5wZ57vs/jCWwiZdoRZXGDohb1D974Avc=; b=Cxpck6uRVCr9CHw42wiFufV5gV+yNzORYAtBgleoIPuDgPVVgKXhBW+nEL1wlsjjq9 jL0/y9tbQ8APXctMp7/UeeDkLUMeIm4gs0Bhok4XFE9i9oPaKe8/H4ZDiPpg4EwTuQfK u3uEkrutGINbR/NrcXYquaRuQ9DXLOu6AbypMp+xdMI7RiPOpy1+kR5PnFUSzVtRrobQ 7EVm4sKNGuBDIega0B6HKx3e/3c5eZLeK0YQzhFnAfef9y4mWpb9rCyEeT0csGPRXp7y EFZUsu7IjQ4p3zsdtdHR0u9vdizVjTP/4PJ8GLJ+CKO1znPrEEQz7WUJDlaMtEz+2g7j gYSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=BwFdgFLF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l32si930298pgm.130.2019.04.17.21.33.23; Wed, 17 Apr 2019 21:33:39 -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; dkim=pass header.i=@chromium.org header.s=google header.b=BwFdgFLF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726013AbfDREcd (ORCPT + 99 others); Thu, 18 Apr 2019 00:32:33 -0400 Received: from mail-ua1-f65.google.com ([209.85.222.65]:36120 "EHLO mail-ua1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725710AbfDREcd (ORCPT ); Thu, 18 Apr 2019 00:32:33 -0400 Received: by mail-ua1-f65.google.com with SMTP id k32so358197uae.3 for ; Wed, 17 Apr 2019 21:32:32 -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=XJvA8v75pU1+NdCQjOMOr1JleGm6RoJuZfTXUbEzgrJkuEh5FVMahrx/6wfZ+qD2OT hYds1KUynVJNL/uNZSBn2QcS3s3FyiZgX2VLNNtxiblqEbHcSVmuVQq/p3qW7jV8xunv p+K2/IDGHZkDSsUIyiH1tc8VICr/Fq3L3K/cMnFbhqC1w04brc4b6n0Zealn/bY5Fe3X iTZXbekOMHhWk7wPYgOSIBsOrWlthoIecNHy9ROQ9kkhqDdPYX9Pp+HW02BNBVXsOW0v oeMhthbiPktO2rNIIi4OwydYnRp12WoE1X2piGCKIVK/1YMNPTsMiBl2eyQJyXiufXOA UmCA== X-Gm-Message-State: APjAAAVgcD720ygQOHqMzYSQfMSyPinbAgjFcq7bJHRJQkJgXD/f4lhj iJemII2GPq0AaJMseNbwW4CSBGe1edc= X-Received: by 2002:ab0:4eaa:: with SMTP id l42mr45061730uah.80.1555561951726; Wed, 17 Apr 2019 21:32:31 -0700 (PDT) Received: from mail-vs1-f44.google.com (mail-vs1-f44.google.com. [209.85.217.44]) by smtp.gmail.com with ESMTPSA id b81sm292672vkf.47.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-f44.google.com with SMTP id e2so432103vsc.13 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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