Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp5836422ybf; Thu, 5 Mar 2020 07:57:34 -0800 (PST) X-Google-Smtp-Source: ADFU+vtSG9ZzRRvsAtPYWg71fPhqByO5GjJDqXhG9FhC+gExecQiCbWwPAdnLk0UFzO2XcySA8jm X-Received: by 2002:aca:ad54:: with SMTP id w81mr6278203oie.172.1583423854089; Thu, 05 Mar 2020 07:57:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583423854; cv=none; d=google.com; s=arc-20160816; b=es/a2JExyF9Dob38cZ49pPl5oAecx7XMkNGk/2JwI4l5oTKcJc/C3KztzGrG8zB46Y bM3AXZnrScitcby+CztQsvP0+gRi+zgXGE2Q4abG4bA2rS2KIhY0R1eTdfcTMQnhw0uy V6uDqKq6C7zlITJMcmsQ2Xh9Dt6nP2jZOZtpzugeTRkZ4syx9mI+cYerzV72cjWU2VkP ejWXsano0S0w0aXHsvhRqH22EzsHLgO6A4kcw6PTM+S5208DB4tkXKp6jo+46iEYmGH9 2Tx7dMwyn81BNaUdeP+6jAypJTwphfvBPukBX6ir2k3wxhW6qXsqNgEuYIo9tSGgAKSw n5tw== 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 :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=zlV2/HhklUPk+6HazhFg2c3NcHDRCugdQYzaRPS6yNU=; b=RWaim18sZmWiu0tc3gW2Icqku6ukLcks8LXX4o9k5PC9wnWLvCfaIe0yjqQBUg5cvV 0nIZHTsGNnZpIs5hvfLWc5zrF1lWZS0PZWlSckc+bZt8t8rQuQgvt00UCKBTlWLwtfHy 4GpOUx/ff6wKa8+0YklqGwNvkO9rkdzdBa/FpXc3Q4eICwPDOooY9y7DL9fu5qy9FDsk +Q0tTdjV9j5MXKwwI2Ry/3pu53B+TV7jMMWsKizG1skuAP/3d/6vE8TjU7wEpilZRDom p7QyOVwNccfLQFlNP9LUTJEuJadSchSj/rU5uhm/MtzWfF8jL0X8699wYqiu4ecfJlEk /y8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20150623.gappssmtp.com header.s=20150623 header.b=oDU5Pv5T; 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 m81si3579867oig.190.2020.03.05.07.57.21; Thu, 05 Mar 2020 07:57:34 -0800 (PST) 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; dkim=pass header.i=@dabbelt-com.20150623.gappssmtp.com header.s=20150623 header.b=oDU5Pv5T; 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 S1727083AbgCEPz1 (ORCPT + 99 others); Thu, 5 Mar 2020 10:55:27 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:34611 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726563AbgCEPz0 (ORCPT ); Thu, 5 Mar 2020 10:55:26 -0500 Received: by mail-pl1-f194.google.com with SMTP id j7so2824215plt.1 for ; Thu, 05 Mar 2020 07:55:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20150623.gappssmtp.com; s=20150623; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=zlV2/HhklUPk+6HazhFg2c3NcHDRCugdQYzaRPS6yNU=; b=oDU5Pv5Tq7eaDkdXZgiOnF2OrFlP5yNMtB7KGbTTN/Bon+6j0m3jnH5bSZGnDWBPGZ DPHh0SnpRCxrWkKm+jyrDnIeiK/wGA3oiSLBoX86vLkwwGlV9ytRFKSyIETYjl610/iA Gwdmez+Pq2qYts0kAvqLHLRctmWiVhyRfO5Oele2kYtm5nuFkTkBa2/MCTG91LXFaZuk A7JJQixojSCqudwflVfKOOJUgDZXKkZSwNavS/lAVo/Ga1Ty7Bblk5hk4aEKJ4+MDjy5 eMhQLETOJiJ2Psrg4sei318QCkfAXFvX9/XQfVocIjeK3xREXHi92BnFrHCBKrvZKJ5+ E8yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=zlV2/HhklUPk+6HazhFg2c3NcHDRCugdQYzaRPS6yNU=; b=ZSi3kld1GgkkGjt9ihIqn8vLbo3hiYbzAN45Z6K5xdPrYTKD/G61t9Q1w1MlqiveZJ MZqaJHa4T5l38bpgWriinrCupsC9k3Q8nf+PqaTVoWR+AXv04CxOjrpZrrjRYFy8idgB B8EdaWN5oFXTG2N1GZOkz7kHveJUY8gE7p04p5vU0O1o+0DY/98AhSCinu53KieAKQXU EJRJFQE1Uh5BSZ28bOCfsR4dqSW+ZCzxyntQ5PfMA3V35OWg+ZUN10i5VvWQ1fik6DDx tNhnSDIoNYP/XrwGomB5q6lIyJmtZH4w0RrztmAQRlirlCLL7ZnbYzUk6O0YYMdy5NeZ xByQ== X-Gm-Message-State: ANhLgQ1EKHADRCdSDSn1f8QhPtqn3ZNs4196/R1W6KaO269ZL7NrkGT9 2EP6CfT8gObfmaFQaC6Dlxd6ng== X-Received: by 2002:a17:902:aa01:: with SMTP id be1mr8440330plb.293.1583423724799; Thu, 05 Mar 2020 07:55:24 -0800 (PST) Received: from localhost ([2620:0:1000:2514:23a5:d584:6a92:3e3c]) by smtp.gmail.com with ESMTPSA id v123sm7307086pfv.146.2020.03.05.07.55.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Mar 2020 07:55:24 -0800 (PST) Date: Thu, 05 Mar 2020 07:55:24 -0800 (PST) X-Google-Original-Date: Thu, 05 Mar 2020 07:55:22 PST (-0800) Subject: Re: [PATCH 0/8] Support strict kernel memory permissions for security In-Reply-To: <20200217083223.2011-1-zong.li@sifive.com> CC: Paul Walmsley , aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, zong.li@sifive.com From: Palmer Dabbelt To: zong.li@sifive.com Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 17 Feb 2020 00:32:15 PST (-0800), zong.li@sifive.com wrote: > The main purpose of this patch series is changing the kernel mapping permission > , make sure that code is not writeable, data is not executable, and read-only > data is neither writable nor executable. > > This patch series also supports the relevant implementations such as > ARCH_HAS_SET_MEMORY, ARCH_HAS_SET_DIRECT_MAP, > ARCH_SUPPORTS_DEBUG_PAGEALLOC and DEBUG_WX. > > Zong Li (8): > riscv: add ARCH_HAS_SET_MEMORY support > riscv: add ARCH_HAS_SET_DIRECT_MAP support > riscv: add ARCH_SUPPORTS_DEBUG_PAGEALLOC support > riscv: move exception table immediately after RO_DATA > riscv: add alignment for text, rodata and data sections > riscv: add STRICT_KERNEL_RWX support > riscv: add DEBUG_WX support > riscv: add two hook functions of ftrace > > arch/riscv/Kconfig | 6 + > arch/riscv/Kconfig.debug | 30 +++++ > arch/riscv/include/asm/ptdump.h | 6 + > arch/riscv/include/asm/set_memory.h | 41 ++++++ > arch/riscv/kernel/ftrace.c | 18 +++ > arch/riscv/kernel/vmlinux.lds.S | 12 +- > arch/riscv/mm/Makefile | 1 + > arch/riscv/mm/init.c | 47 +++++++ > arch/riscv/mm/pageattr.c | 187 ++++++++++++++++++++++++++++ > 9 files changed, 344 insertions(+), 4 deletions(-) > create mode 100644 arch/riscv/include/asm/set_memory.h > create mode 100644 arch/riscv/mm/pageattr.c Sorry, I had to run last night without quite finishing the patch set. Just so we're on the same page: there's some issues with the patch set, I'm assuming you're submitting a v2 so I'm dropping this from my inbox. Thanks!