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=-8.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,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 AAD45C433EF for ; Tue, 21 Sep 2021 14:42:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 371D06109E for ; Tue, 21 Sep 2021 14:42:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 371D06109E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id BC87E940008; Tue, 21 Sep 2021 10:42:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B77EF940007; Tue, 21 Sep 2021 10:42:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A67E3940008; Tue, 21 Sep 2021 10:42:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0061.hostedemail.com [216.40.44.61]) by kanga.kvack.org (Postfix) with ESMTP id 9708A940007 for ; Tue, 21 Sep 2021 10:42:21 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 54854181E188B for ; Tue, 21 Sep 2021 14:42:21 +0000 (UTC) X-FDA: 78611846082.10.19D1440 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) by imf23.hostedemail.com (Postfix) with ESMTP id 71C3290000A6 for ; Tue, 21 Sep 2021 14:42:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=DGmMlpMUOkTm4vKPa5AEfE6wFxS3ZaoVAuAsiouoBDs=; b=i9Tw3ddTfL/uisviclxGr07dZc HxtkqOTnD4r9N9lLOO+xX4gwRfSReCkhZB9gjFIykZI0RlZxO4P+pC4l1o2ha2HDUrypVLpXQrB/C nQYkdcNvLlN7/BLiNnfK4Tf+kbskciQiUl8skyQQO7c5OEjItLxV3+X1MR8R/eSi4Mc6ydtwGFCR7 osRlydbOnmYlOwNhayYpLYxh8YKoDlgqJ1DND/g9L5fgsLTFW7PPl+KdaKx2tlB41lk5yb8lMy0Ug GxwLHU5WMuamwXA1rwnZvWZsq0R8ibYtbdte0I4wrzfTOYiGZObHT8LIDf2KQK9TUZtjKd1l33ze+ 1NA1Qi5Q==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSgxv-004mZ4-P5; Tue, 21 Sep 2021 14:41:47 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 96310300252; Tue, 21 Sep 2021 16:41:45 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 7B9892659EB7C; Tue, 21 Sep 2021 16:41:45 +0200 (CEST) Date: Tue, 21 Sep 2021 16:41:45 +0200 From: Peter Zijlstra To: sxwjean@me.com Cc: x86@kernel.org, linux-mm@kvack.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, luto@kernel.org, krisman@collabora.com, chang.seok.bae@intel.com, viro@zeniv.linux.org.uk, nivedita@alum.mit.edu, adobriyan@gmail.com, oleg@redhat.com, sblbir@amazon.com, axboe@kernel.dk, laijs@linux.alibaba.com, dave.hansen@linux.intel.com, akpm@linux-foundation.org, arnd@arndb.de, davem@davemloft.net, keescook@chromium.org, kim.phillips@amd.com, yazen.ghannam@amd.com, dave@stgolabs.net, metze@samba.org, elver@google.com, ebiederm@xmission.com, christophe.leroy@csgroup.eu, linux-kernel@vger.kernel.org, Xiongwei Song Subject: Re: [PATCH RESEND 2/2] x86/mm: Randomize va with generic arch_pick_mmap_layout() Message-ID: References: <20210921143414.70723-1-sxwjean@me.com> <20210921143414.70723-3-sxwjean@me.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210921143414.70723-3-sxwjean@me.com> X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 71C3290000A6 Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=i9Tw3ddT; dmarc=none; spf=none (imf23.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org X-Stat-Signature: 9e7uwgam8fy5pger8jhz6hndtniqdxx8 X-HE-Tag: 1632235340-896883 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 Tue, Sep 21, 2021 at 10:34:14PM +0800, sxwjean@me.com wrote: > diff --git a/arch/x86/include/asm/compat.h b/arch/x86/include/asm/compat.h > index 7516e4199b3c..c697e377644d 100644 > --- a/arch/x86/include/asm/compat.h > +++ b/arch/x86/include/asm/compat.h > @@ -151,6 +151,11 @@ struct compat_shmid64_ds { > compat_ulong_t __unused5; > }; > > +static inline int is_compat_task(void) > +{ > + return IS_ENABLED(CONFIG_COMPAT) && test_thread_flag(TIF_32BIT); > +} > + This is still fundamentally broken for x86. x86 doesn't have compat tasks, the granularity is at syscall at best.