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,URIBL_BLOCKED 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 2C190C10F14 for ; Thu, 18 Apr 2019 04:32:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EC807217D7 for ; Thu, 18 Apr 2019 04:32:34 +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 S1726405AbfDREcd (ORCPT ); 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-Google-Smtp-Source: APXvYqxDscnBD8IAdqG/V1NGtPqaa1IFiRwN924LPW+7w3DO/I9ZbmMc17WlPAKZ6UlH4ANh436kTA== 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 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.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS autolearn=ham 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 1F831C10F0B for ; Thu, 18 Apr 2019 04:32:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DDA052184B for ; Thu, 18 Apr 2019 04:32:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="THl+Q7DF"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="BwFdgFLF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DDA052184B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bTMpyQ+iy46We8vD2Y58HhjjLehCeYpE95v3We9Ot2c=; b=THl+Q7DFIo2JPX siW/JQuDsLoxgr4InmQZmMCekZKcZuzyglCGsQknNXJ6v3/IZlbSrXWvWx//p/7L5WTCaHj9qixA8 AccvbA11qG4yHoj2YdqzIJllRV63VMua/8RuDd7xYDcEANMi04JhszyQhp0SBCZQ/xqpAoYhseEM7 3UIHG1JtfFLSUiynjaBHvYosjZ2Su6h8X/ZWd0jNPiqUA+Fmeu75d+ULx5qCoEnLVl2P0/vu4P7d+ 5ea3LWgGQ3q6HvBG+499YNCML8s5Ck9UHtk+H02hyTkncA5kb9ZR4Kq6nn+to/y6IyhNriMq7Tkqc wsUCHPqNp0BmCo1DN+1w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGyj4-000682-ER; Thu, 18 Apr 2019 04:32:42 +0000 Received: from mail-ua1-x943.google.com ([2607:f8b0:4864:20::943]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGyiw-0005tl-CK for linux-riscv@lists.infradead.org; Thu, 18 Apr 2019 04:32:35 +0000 Received: by mail-ua1-x943.google.com with SMTP id k32so358201uae.3 for ; Wed, 17 Apr 2019 21:32:33 -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=ROKSuM/MbDSO2MAiHGZi+sEaG8ufCzUEkI4jijhLPNreicQJWaHthl/vj7rT0teEzc 5A3gbDyKWbBPRb31MzcWzmCWjL6A2qgYAMxEUWQL1xA/Lh45JFXOgqVrT9v3eHblguuF MKa4mJAXKYV8vboNNaoZXBH41Ydql81tSTZU60UkJ0MeI1Ld5Sp0efWDaw+7OXgp0UrD ssi7jU3jRFQxNVuruxiqQzxxpgOV96/HzayZXr5xN/0sBuIpw4kJ7g0Ibhbv6Bp2TX/q E+Bc4Oj56jx4Wb/UEZWhtI7V6VhOnAlxIt28zt22mw58uDaRJlIa+cet6qyafDPJKhzG 87ow== X-Gm-Message-State: APjAAAWaVm23GPO5pGTrE83ajpr6IVqmi31kHUNRvSJnXDv7GNE2Fbqm ZG6Zq0LsTxihkd+82qPzAqNEcbnScFs= X-Google-Smtp-Source: APXvYqwAJFu6EVI5qYenc4wdsXYggVGuAVW7BKvXFH+L5s2FOLWiIFzQfV7tEIjcsDqILejv0D/qxg== X-Received: by 2002:ab0:4870:: with SMTP id c45mr20741140uad.21.1555561951862; Wed, 17 Apr 2019 21:32:31 -0700 (PDT) Received: from mail-vs1-f53.google.com (mail-vs1-f53.google.com. [209.85.217.53]) by smtp.gmail.com with ESMTPSA id t201sm331156vke.15.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-f53.google.com with SMTP id g187so447558vsc.8 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190417_213234_471907_2C4A5FBA X-CRM114-Status: GOOD ( 16.10 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Albert Ou , Kees Cook , Catalin Marinas , Palmer Dabbelt , Will Deacon , Russell King , Ralf Baechle , LKML , 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv 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=ham 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 BBC77C10F0B for ; Thu, 18 Apr 2019 04:32:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6D018217D7 for ; Thu, 18 Apr 2019 04:32:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="BwFdgFLF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6D018217D7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0A8816B0007; Thu, 18 Apr 2019 00:32:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 02CBE6B0008; Thu, 18 Apr 2019 00:32:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E37CD6B000A; Thu, 18 Apr 2019 00:32:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from mail-vk1-f197.google.com (mail-vk1-f197.google.com [209.85.221.197]) by kanga.kvack.org (Postfix) with ESMTP id BB3776B0007 for ; Thu, 18 Apr 2019 00:32:33 -0400 (EDT) Received: by mail-vk1-f197.google.com with SMTP id l11so401505vkl.14 for ; Wed, 17 Apr 2019 21:32:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:mime-version:references :in-reply-to:from:date:message-id:subject:to:cc; bh=emqG7/19kpW5wZ57vs/jCWwiZdoRZXGDohb1D974Avc=; b=iJr4DtMnELTYM8yltMMMHCiSU9YpSIa+gk+mJOjoJHI/gPnlpEjEbewlrIklhxWvLc f4ln1cu7XtF20TqAEx08o61sP9exHmu6R9emau1XCo7LBA6SN7oli25MSkdsEEvhhIfe xW5K+vYJMgEUWTeO5HwTNyhKPSuYwZiQu6iG1uWxEU5/khd50GN2bho+QDXiA6zQ7FLl XOHiwYGNGrjKxUxWjPq8iyTPHtqW9sQdVRQkrp52LkJr9dg2C7P/46kOW60x52LZ+HVW hgx1JV9Sll/EUyjHxoeUtN+01F+vH9f9lUAPCbDm9NVBvBoXmeqZMC5P4CNy4HSWHeMz wTOw== X-Gm-Message-State: APjAAAWVZeWTzgctGqz6ZD3yjI4IxQfrnO1zgbdne5hpjvo/63pT+uLz ppByda7xmecqNjqax6pVChks2T6z0d3z6Fh/puXTdocTgliLFs2niQprkxt3w5wWPsjO0if0CVC jYHYhLu0Uv00e5HbNVW7wPyDvYxs/RdJxv0ZCFfIpT4XBLRUGUsn8z5QaqMYimW42bw== X-Received: by 2002:a67:ed84:: with SMTP id d4mr27881000vsp.207.1555561953306; Wed, 17 Apr 2019 21:32:33 -0700 (PDT) X-Received: by 2002:a67:ed84:: with SMTP id d4mr27880972vsp.207.1555561952653; Wed, 17 Apr 2019 21:32:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555561952; cv=none; d=google.com; s=arc-20160816; b=Pni3oFVBSGtqz3dcWo4ZWcibvw/u2YaDH8sdFnXu2NAsC/cZM2TreKO+4AiMYeneBW 8NdBEu1G0cGEAjJ2RBDNY5Lr8PFM0FBUX5oodJ43E6jal1aitb1yTlLTswUoDIg+7RNO q1dGk2gREAIuEI3g4C9UHHPwi/GDcJGsWJi2DnWZRFDcriZX2DKIqnMQQhZ1M0O5I13O 7aUk6gA4S17Zq5cghp17l03/xDQWyh4Bcn3u5hv216+kj09BujSSfD9JuLTUoDZXBijs cdthWLcB7hQxiFlmri1kBU8XYBc0qd4hroATCqnHDQdW9PBYjiLpPn2oM2EM1XESr1Ul dB/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=emqG7/19kpW5wZ57vs/jCWwiZdoRZXGDohb1D974Avc=; b=KabNSsk5YfUjG4c1fYXgXTsbndOfKtZPzUomLGEZGFbnoRxNhHUvF9xGJZ9Ma6w+Vl ICii09sNGP54Qt/EjKgTX/93OlNVzIiPJ2vNlLY0ZnZRDWIKqC4RB4ZQ9JiW1IKgCjjl 0ySkkuAuyV7Ow9+y49dk6ozseKXlsJ9oF5MtXpE/h2Vn8CiRSEJkM4b/+RdWYH67rY+0 eJPhmq9upVE3CTsqmbN9QjHyvbUNn/VaQzDuCu+7VkTxqlDIQIUm8xykO5K/ycWuWypw KHUkLOHD///3TNmXJJqIe029V+lUHoHsCyND6H+5XGzLmbPJ4DbLoYjN4rTRXUNvfG0z Qp3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=BwFdgFLF; spf=pass (google.com: domain of keescook@chromium.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=keescook@chromium.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id h17sor331576vso.124.2019.04.17.21.32.32 for (Google Transport Security); Wed, 17 Apr 2019 21:32:32 -0700 (PDT) Received-SPF: pass (google.com: domain of keescook@chromium.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=BwFdgFLF; spf=pass (google.com: domain of keescook@chromium.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=keescook@chromium.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org 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-Smtp-Source: APXvYqxNfTQaquF8Iq7aLFSABAnJvOUtXNRWLXx6YAbhJNmOBsZ1onajyGWhhBeKXAAw5MA/Dm/OZg== X-Received: by 2002:a67:f714:: with SMTP id m20mr52068543vso.211.1555561951773; Wed, 17 Apr 2019 21:32:31 -0700 (PDT) Received: from mail-vs1-f53.google.com (mail-vs1-f53.google.com. [209.85.217.53]) by smtp.gmail.com with ESMTPSA id 2sm1530612vke.27.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-f53.google.com with SMTP id j184so437704vsd.11 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" 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: 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 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.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 C8E81C10F0E for ; Thu, 18 Apr 2019 04:32:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 97A802184B for ; Thu, 18 Apr 2019 04:32:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ePpW3HtO"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="BwFdgFLF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 97A802184B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/AYLXGjJ2qFVjxwRbCF2ZocLUFoMrp2YjGZgNi/pn0c=; b=ePpW3HtOjnid5Y zPHEtLgQXU38zjFmMjJeJdgUpT4Zjx0cIrMx+XOcVuYtLoxiUeTp463STEh3wK7CRWqK5TBYyNxlb fo2JYYGym0BquYFIWeEm+xN5V/4J0LKwg5y3SpAjhWEHFHNyQG7g8SV5HEm0xC+SJWgJBfEPT1Yz5 P4fQhteU9zf8CemheJgERGwLel/NFj5zAaYeglQ+gO7GUipWNM0eKVirfARs9hZDdPOrVbzgy0MgS 1cqF4grM+XdzDGPSmQYwCWGoHsN1KRUuYswuANemuAYocl6VNF4yiLyfZ3+N2K4QueqLlvhov+ecH xrLe3RAu+J+a0ZXu+7mA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGyiy-0005xX-BH; Thu, 18 Apr 2019 04:32:36 +0000 Received: from mail-ua1-x944.google.com ([2607:f8b0:4864:20::944]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGyiw-0005tk-2b for linux-arm-kernel@lists.infradead.org; Thu, 18 Apr 2019 04:32:35 +0000 Received: by mail-ua1-x944.google.com with SMTP id h4so343662uaj.9 for ; Wed, 17 Apr 2019 21:32:33 -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=ALO5GqbK9HkXzcL1JXdHKIf3X1yHglbtQGAuLjk/yTkkhneRh38jT6qN6y4PRFzTBd IOaubrcpCgRqmj6d/dZChp4V2YpZrQG9MHYzI2qkn2P2aLSS+UHt3jvSHyO+lR+pFzHo KxLwX0/0/1hpfALMe5UP3oWQe2GSehOjIYmsqXXwEvwItz2l5X+A2eEyA3pPWS7YIrLm EGpgVX58dDSmw+oRD29/WfSpBfxiKbLCptoymHGZGNG16eCQ10kj/aB872JdEEDcS/KE FLtIKu6iKw0BgPJXZVsd0d7TFQKzoLJYwzgyRmbR4Xir2EdPZHJiSQoOAO+r5Ro6jdz2 Sgkw== X-Gm-Message-State: APjAAAWyAAD8vGcpSicfGUABsjl3zTsN8AcCGOdVKWERSNVYUDeVqWw3 UhPDvrUGiCVwqXswFQ2yzdSMNZBnMEI= X-Google-Smtp-Source: APXvYqzqMMN/cCb0GOcxnPSv2LABcrG35D1w8gqK7G3qWKYPnMNoDCk/lHS6VI7wYsq0kdaBJoBd7g== X-Received: by 2002:ab0:644c:: with SMTP id j12mr22243780uap.61.1555561951812; Wed, 17 Apr 2019 21:32:31 -0700 (PDT) Received: from mail-vs1-f43.google.com (mail-vs1-f43.google.com. [209.85.217.43]) by smtp.gmail.com with ESMTPSA id t201sm331155vke.15.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-f43.google.com with SMTP id g127so452362vsd.6 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190417_213234_142531_DD5EE38B X-CRM114-Status: GOOD ( 17.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Albert Ou , Kees Cook , Catalin Marinas , Palmer Dabbelt , Will Deacon , Russell King , Ralf Baechle , LKML , 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel