From patchwork Tue Sep 21 11:02:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiongwei Song X-Patchwork-Id: 12507679 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,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 5A2A9C433F5 for ; Tue, 21 Sep 2021 11:04:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0994C6115A for ; Tue, 21 Sep 2021 11:04:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0994C6115A Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=me.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 9D9C8900002; Tue, 21 Sep 2021 07:04:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9893D940009; Tue, 21 Sep 2021 07:04:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 829E1900008; Tue, 21 Sep 2021 07:04:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0236.hostedemail.com [216.40.44.236]) by kanga.kvack.org (Postfix) with ESMTP id 7545D900002 for ; Tue, 21 Sep 2021 07:04:14 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 3B0261802EB2E for ; Tue, 21 Sep 2021 11:04:14 +0000 (UTC) X-FDA: 78611296428.03.75A99C8 Received: from pv50p00im-ztdg10011301.me.com (pv50p00im-ztdg10011301.me.com [17.58.6.40]) by imf03.hostedemail.com (Postfix) with ESMTP id E6F4530000AE for ; Tue, 21 Sep 2021 11:04:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1632222252; bh=qKQEOuLkz9rupJ8tm470ugxnMVFuW3h1Tk7tw22voKM=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=NViApuCru0vMSJB5RPBpcMC2Of1EMzEt7tUr73/fopKQysEDa1rGjH+qDwo0Mr3xM 1Y2J1HUWF1ASGWnUiWElYzMS8mNYiqaywWCUdNSKvlYGibc/8vqdhoynixtETOa0Em 88AORBjmVXyihSXh741XG/yLZZ/LQcEXNfL8rSWo8A+9mOeKwt55qK60jOxG5+ZCPn BbxW7bEBWoLm7NZ1FgqBjuUeRwP2bTMzNc0yPzeqMkIzBhW02Bjy/fMtqGjFcsnjCs 1XgVTq9JmYGb3iw2veLo4G8yQUkY2XMVFuSJQfhkAUSor+YgZ4hpmagt4eD3DjchEE LqkwxhGFyzr8Q== Received: from xiongwei.. (unknown [120.245.3.37]) by pv50p00im-ztdg10011301.me.com (Postfix) with ESMTPSA id B2FD276035E; Tue, 21 Sep 2021 11:03:55 +0000 (UTC) From: sxwjean@me.com To: x86@kernel.org, linux-mm@kvack.org Cc: sxwjean@me.com, Xiongwei Song , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Andy Lutomirski , Gabriel Krisman Bertazi , "Chang S. Bae" , Al Viro , Arvind Sankar , Alexey Dobriyan , Oleg Nesterov , Balbir Singh , Jens Axboe , Lai Jiangshan , Dave Hansen , Peter Zijlstra , Andrew Morton , Arnd Bergmann , "David S. Miller" , Kees Cook , Kim Phillips , Yazen Ghannam , Davidlohr Bueso , Stefan Metzmacher , Marco Elver , "Eric W. Biederman" , Christophe Leroy , linux-kernel@vger.kernel.org Subject: [PATCH 0/2] Use generic code for virtual address of randomization of x86 Date: Tue, 21 Sep 2021 19:02:50 +0800 Message-Id: <20210921110252.2593542-1-sxwjean@me.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-09-21_01:2021-09-20,2021-09-21 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2009150000 definitions=main-2109210070 Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=me.com header.s=1a1hai header.b=NViApuCr; spf=pass (imf03.hostedemail.com: domain of sxwjean@me.com designates 17.58.6.40 as permitted sender) smtp.mailfrom=sxwjean@me.com; dmarc=pass (policy=quarantine) header.from=me.com X-Stat-Signature: iw54ar889qbpk86xj8ypna1egqog4eme X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: E6F4530000AE X-HE-Tag: 1632222253-317648 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: From: Xiongwei Song Hello, The two patches are to use generic code for randomization of virtual address of x86. Since the basic code logic of x86 is same as generic code, so no need to implement these functions on x86, please see the details in comments of patch 2. Please review it. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Andy Lutomirski Cc: Gabriel Krisman Bertazi Cc: "Chang S. Bae" Cc: Al Viro Cc: Arvind Sankar Cc: Alexey Dobriyan Cc: Oleg Nesterov Cc: Balbir Singh Cc: Jens Axboe Cc: Lai Jiangshan Cc: Dave Hansen Cc: Peter Zijlstra Cc: Andrew Morton Cc: Arnd Bergmann Cc: "David S. Miller" Cc: Kees Cook Cc: Kim Phillips Cc: Yazen Ghannam Cc: Davidlohr Bueso Cc: Stefan Metzmacher Cc: Marco Elver Cc: "Eric W. Biederman" Cc: Christophe Leroy Cc: linux-kernel@vger.kernel.org Xiongwei Song (2): x86: Rename TIF_ADDR32 to TIF_32BIT x86/mm: Randomize va with generic arch_pick_mmap_layout() arch/x86/Kconfig | 2 +- arch/x86/include/asm/compat.h | 7 +- arch/x86/include/asm/elf.h | 2 +- arch/x86/include/asm/page_64_types.h | 6 +- arch/x86/include/asm/processor.h | 4 +- arch/x86/include/asm/thread_info.h | 4 +- arch/x86/kernel/process.c | 5 -- arch/x86/kernel/process_64.c | 4 +- arch/x86/mm/mmap.c | 112 --------------------------- include/linux/compat.h | 4 + mm/util.c | 18 ++++- 11 files changed, 37 insertions(+), 131 deletions(-)