Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9170372ybi; Tue, 23 Jul 2019 23:14:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxT+qFqGSFcntSFZL8EaliltKnq8Zm2U8j8VNxnlRz4SQRGfbeAeYYqVx6L8+0E57P4v+iL X-Received: by 2002:a17:902:ff11:: with SMTP id f17mr85823219plj.121.1563948850146; Tue, 23 Jul 2019 23:14:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563948850; cv=none; d=google.com; s=arc-20160816; b=wWh68SOj5w9olGuz/bOcLSjp/XKtoVkC2aIh6woNDEN2GTKl0CtyZy/ugxl+iylVfk gDRwqJJgdx7UCRSyuvtV5yUx7FuFzHh6heqaJyZFIexhMSAIAzGnIDMyT1L7sFh8xkXS qpgRkOU4yToUG4U3H4mILGnxH/zmvgHYVJ2LjLhnb4RImdDcbecy/4sG1AkjcMj8dcV1 9XIrmmaiCXxr+MlrI8fG7lNWPRVwRJSECLOiMvTG16RfzLCbkZGQ3ZVAJwEbrnlKPVT6 xYCsteq16vkGm+A3LRZrf+7bV/zVVRhGuOfBOuRAzleya1mzdO0xET8Gz7JYYVA6PqV+ 50eA== 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=66FrIHCi/FwU5Qd+YH0GklxRIkE/On5h0rf1MXh1DUQ=; b=KQSYPFlcPP1oXvk3PsNGCsj2ybd+Y8s/Srafkl/WreeTNmPV6cqZJMfCgJ0nLBqPHZ erlQgxcrUABN0guo6G2ewv9p7VODFoTpWfyHudXRHkvAT+yvI+pAmuy1vc8TVft7unnU UMMLlzpOAnvfHOaX9si1FymZi8F4uZHfl0OVsOw2zPxD7pumvV+uYtxgjjfrF//IMty5 y6XKwlWhlDAEFYa9ZgBk2Q7vT1IY5mAcCIa73Z1pmp9rSeDPs5x9MsFQlGEa3zx9F+sB rodYNHifsdlY6NqcJ0+04t0QLf2dwZ0LnMbxrkJkFm8znLQL6K40QUiuBXJAnhStwZ8E Yt0g== 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 d34si13973548pld.54.2019.07.23.23.13.55; Tue, 23 Jul 2019 23:14:10 -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 S1726248AbfGXGMJ (ORCPT + 99 others); Wed, 24 Jul 2019 02:12:09 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:42379 "EHLO relay11.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725870AbfGXGMJ (ORCPT ); Wed, 24 Jul 2019 02:12:09 -0400 Received: from alex.numericable.fr (127.19.86.79.rev.sfr.net [79.86.19.127]) (Authenticated sender: alex@ghiti.fr) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 8BB91100006; Wed, 24 Jul 2019 06:12:01 +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 12/14] mips: Replace arch specific way to determine 32bit task with generic version Date: Wed, 24 Jul 2019 01:58:48 -0400 Message-Id: <20190724055850.6232-13-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 Mips uses TASK_IS_32BIT_ADDR to determine if a task is 32bit, but this define is mips specific and other arches do not have it: instead, use !IS_ENABLED(CONFIG_64BIT) || is_compat_task() condition. Signed-off-by: Alexandre Ghiti Reviewed-by: Kees Cook --- arch/mips/mm/mmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/mips/mm/mmap.c b/arch/mips/mm/mmap.c index faa5aa615389..d4eafbb82789 100644 --- a/arch/mips/mm/mmap.c +++ b/arch/mips/mm/mmap.c @@ -17,6 +17,7 @@ #include #include #include +#include unsigned long shm_align_mask = PAGE_SIZE - 1; /* Sane caches */ EXPORT_SYMBOL(shm_align_mask); @@ -191,7 +192,7 @@ static inline unsigned long brk_rnd(void) rnd = rnd << PAGE_SHIFT; /* 32MB for 32bit, 1GB for 64bit */ - if (TASK_IS_32BIT_ADDR) + if (!IS_ENABLED(CONFIG_64BIT) || is_compat_task()) rnd = rnd & SZ_32M; else rnd = rnd & SZ_1G; -- 2.20.1