Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2789998pxb; Tue, 21 Sep 2021 07:44:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy43IYi8lRrkdmx9PNjEZ3iAPtrT4jocz7A2fRTkVMlxjBFe6VYUa9dSzKasRWdpnuOO3dD X-Received: by 2002:a02:cd17:: with SMTP id g23mr280580jaq.29.1632235443243; Tue, 21 Sep 2021 07:44:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632235443; cv=none; d=google.com; s=arc-20160816; b=wcngi9OkopOlVt7Rsl9rjCWW23ywM2uvd0m14DFyW3/qTVJavQzyMgZ1I5SoqrhhKJ HhgRlcAAcs/syyLLHh/Hig7aHXQesRRJDZZyluOyKKheh9VGFPGRwULUr1RMXuC4dro5 efbkB623F382hwGSSwu1Te2QIg+2OVp6wAPW35EMA2nfeewX14+yjne59XGQ6lD0yNTB u5/4C3JpPJJO8KvagpzPYp9vK8ASJ2Hwariea0KRGg2S14PF4Hdo+GiKJHac5+m2IHv+ VALQURI5cavtOo3TMmiSJJZh+yW4iDvQagEtBv3QAuPtVqkaRFc0uUOlE6gtXX85aNY5 lOLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=DGmMlpMUOkTm4vKPa5AEfE6wFxS3ZaoVAuAsiouoBDs=; b=dSyxaHQLmdHnEnNTzm2UD/xX4DRCisYBMHKb3uoJ0+PrqyJ8UNjwkA+geT4SJ3m2m6 UVm4EXtiBBwj8qIamAScCsovFtq3Nsbzge58Sy+HDEz1mNdbiVuZ7Sfg0mczhie1kxpZ HjslQi0qBIr7DQSfbP0QczGF9/5LPshRJEXepV/HjwxqceoxXQqPQw/PnTdafVvaDBmD 4j5wII0o78ch+ysAJXNUTp0gEUOWpRiyUGG4gdKHK7MPC6J6u9QnAWr1kWfdi6SFsOe8 o9GAg7zSFwbPVdVC3wHPp4S8jClbmg4+DTrpkr4h0+fTGA9pkv1eQKIyHo/y2+teZkpC 4InA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=i9Tw3ddT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e25si764867jaa.45.2021.09.21.07.43.49; Tue, 21 Sep 2021 07:44:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=i9Tw3ddT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233688AbhIUOoW (ORCPT + 99 others); Tue, 21 Sep 2021 10:44:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233627AbhIUOoV (ORCPT ); Tue, 21 Sep 2021 10:44:21 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA761C061574 for ; Tue, 21 Sep 2021 07:42:51 -0700 (PDT) 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.