Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2732920ybi; Sun, 26 May 2019 06:52:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqymUOVu3dNOajdRk0e7j09I5jeDvfy9fGRZJVZdQC8v6d3ySfUvtH4QJu5Ha1Mik7lipvLj X-Received: by 2002:a17:902:27e6:: with SMTP id i35mr14053760plg.190.1558878722441; Sun, 26 May 2019 06:52:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558878722; cv=none; d=google.com; s=arc-20160816; b=DyXJD7KK5BP0zHrMmi9ehHO7ZrfMZZagDyJCCg2xAHuvdmD1QcsRj87LjnxLT+glVZ xrxtLIvT+5bZwQC7APasDx51cKvAy0FFMei8nzRDG1WL9J5e7aiHTfsP/HRvQ8edNefC reb4DtG0ubMeIJaRQrk0Q2oY5DCOveuzyox5E4HYpJSu8CQzvhj+jZ7OSNbJ/r6V1+Ao QGDa9pOl7dq7xTR6VoT+jD9Wd+mDK946dbK9QEbk8mWR+QlLwfIDkJqddX5PbYwLPIhS /LRpJWztamU4Uy2yjFSyuc/oSNroqqzZVKEyLsXLPZPyqiW9HwyiL/aaOIeASMtKUJlt tLNw== 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=dEuG6Wupa95dC9izLwtsSW8dwaH2/9q+MhpkifLzt/c=; b=yVHFQZL1CBaNcHAVrn96fOnqNweFyZRXLQ04WeiVIg/XxJVu2yDnuheqs29SsdqWQu 6gLsWXyglRUx0Y16I4NhoiAN5Mokxu1D8lHOuBiwXK+V9B9Q8imq4XfzXZiublW8k9U9 2UhTgfzSgJqqlhPPWxBdBZhDXZThO3+pV8ILY/1scNDkw2oeRSazMduEgS7GiaH+0bOQ jE8sas7po17QZGcGic54qHIDsIISiAjMVOS4Yjjfm8IhJdbMm5xcyJ1zZhRqGDkKRT4K bih8z035TZjq+SffKwxevu5SwmotB+Wa9bEc/wNYuofQ5wUz98cFlnyzqp7NhDvhi/J1 SfJQ== 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 h25si14567356pfn.209.2019.05.26.06.51.47; Sun, 26 May 2019 06:52:02 -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 S1727829AbfEZNuc (ORCPT + 99 others); Sun, 26 May 2019 09:50:32 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:52067 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726953AbfEZNub (ORCPT ); Sun, 26 May 2019 09:50:31 -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 relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 7A7651C0009; Sun, 26 May 2019 13:50:16 +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 v4 02/14] arm64: Make use of is_compat_task instead of hardcoding this test Date: Sun, 26 May 2019 09:47:34 -0400 Message-Id: <20190526134746.9315-3-alex@ghiti.fr> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190526134746.9315-1-alex@ghiti.fr> References: <20190526134746.9315-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: 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 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