Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9158985ybi; Tue, 23 Jul 2019 23:02:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqzmUbFu07avpvgCnBvVgC7QyS44HjyE3hiZEK/ID4SPi+t6Uefz90wTUkxIj74ovq0g+sql X-Received: by 2002:a17:902:bf09:: with SMTP id bi9mr78931786plb.143.1563948129162; Tue, 23 Jul 2019 23:02:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563948129; cv=none; d=google.com; s=arc-20160816; b=dATtlcgMeXgjnR85REqwmfrJiyaLD7EYOKIwREmNTY8f7i8WYuCAMinisH3ispZ2ZA jxbBXPPJW0H8ZkWqmaqoYx0DaWo1f8rJkFtfXxCKc/3nsLAUcsInyIq2Pve4jqk+o9kE tx3NyL29naQcAf+vA4Y2W2zfKrzByKw/JHtR2z5eJM/P2O5GN3S21TjNYnsXLf2S9xBg mtFmSEK1JQOwn1GH+upOsWm4hqunaBRe2wcSRg4JAsUCaOxF8RXDDAPc3v+7t6CCfAvZ FsP5AxTRnstPR0MWp7Ob0Zw8rqqig5ruA5OlZ3i5DGSu2VGQrMcMA7ruPoo4P8h47pUg ZrZg== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=aZSsJFYvbjj8QOQUi6BNWizJJ333ywVv4QtORhWQawg=; b=WIgtvdxua/0r3M9DqQpA8U4oX36oYHKlml4WNmAlRm1Q1pjNVMQ67XJD62XpqL3fMs E3UbALykXpJEbeuDMMI9ulPfyIe5PkpXQr6zTZtJk/w8Px7/Fc6CydRy/Na4PcEkS1Lp W9fL8Z4+g93DsaabUtJH8lFlYAMpixmJckBSBBzVPqKIg9f2GS7CGcgkOgREXAaRmaQJ DzX5IGOBN2glCjDo5SdN0WylBuk3+xQPBsS8bRwC5n42RQoO/DbT5p4AeCKBLkjp+fCJ N7ahuvDhdpHXrLbWvUlQlp+cQC2rocJceTs1lM3hdSq9DMDRRg/1n+0G6etP1Jszjm+z Xbmw== 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 u16si17330078pjb.15.2019.07.23.23.01.53; Tue, 23 Jul 2019 23:02:09 -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 S1726298AbfGXGBQ (ORCPT + 99 others); Wed, 24 Jul 2019 02:01:16 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:59335 "EHLO relay6-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725870AbfGXGBQ (ORCPT ); Wed, 24 Jul 2019 02:01:16 -0400 X-Originating-IP: 79.86.19.127 Received: from alex.numericable.fr (127.19.86.79.rev.sfr.net [79.86.19.127]) (Authenticated sender: alex@ghiti.fr) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 05075C0002; Wed, 24 Jul 2019 06:01:09 +0000 (UTC) From: Alexandre Ghiti To: Andrew Morton Cc: Christoph Hellwig , Russell King , Catalin Marinas , Will Deacon , Ralf Baechle , Paul Burton , James Hogan , Palmer Dabbelt , Albert Ou , Alexander Viro , Luis Chamberlain , Kees Cook , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Alexandre Ghiti Subject: [PATCH REBASE v4 02/14] arm64: Make use of is_compat_task instead of hardcoding this test Date: Wed, 24 Jul 2019 01:58:38 -0400 Message-Id: <20190724055850.6232-3-alex@ghiti.fr> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190724055850.6232-1-alex@ghiti.fr> References: <20190724055850.6232-1-alex@ghiti.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: Catalin Marinas Acked-by: Kees Cook Reviewed-by: Christoph Hellwig --- 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 b050641b5139..bb0140afed66 100644 --- a/arch/arm64/mm/mmap.c +++ b/arch/arm64/mm/mmap.c @@ -43,7 +43,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