From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on archive.lwn.net X-Spam-Level: X-Spam-Status: No, score=-5.7 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by archive.lwn.net (Postfix) with ESMTP id 067077D918 for ; Mon, 28 Oct 2019 02:42:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730198AbfJ1Cm0 (ORCPT ); Sun, 27 Oct 2019 22:42:26 -0400 Received: from 59-120-53-16.HINET-IP.hinet.net ([59.120.53.16]:45349 "EHLO ATCSQR.andestech.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729378AbfJ1CmZ (ORCPT ); Sun, 27 Oct 2019 22:42:25 -0400 Received: from mail.andestech.com (atcpcs16.andestech.com [10.0.1.222]) by ATCSQR.andestech.com with ESMTP id x9S2Ns1u087163; Mon, 28 Oct 2019 10:23:54 +0800 (GMT-8) (envelope-from nickhu@andestech.com) Received: from atcsqa06.andestech.com (10.0.15.65) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.123.3; Mon, 28 Oct 2019 10:41:22 +0800 From: Nick Hu To: , , , , , , , , , , , , , , , , , CC: Nick Hu Subject: [PATCH v4 0/3] KASAN support for RISC-V Date: Mon, 28 Oct 2019 10:40:58 +0800 Message-ID: <20191028024101.26655-1-nickhu@andestech.com> X-Mailer: git-send-email 2.17.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.0.15.65] X-DNSRBL: X-MAIL: ATCSQR.andestech.com x9S2Ns1u087163 Sender: linux-doc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org KASAN is an important runtime memory debugging feature in linux kernel which can detect use-after-free and out-of-bounds problems. Changes in v2: - Remove the porting of memmove and exclude the check instead. - Fix some code noted by Christoph Hellwig Changes in v3: - Update the KASAN documentation to mention that riscv is supported. Changes in v4: - Correct the commit log - Fix the bug reported by Greentime Hu Nick Hu (3): kasan: No KASAN's memmove check if archs don't have it. riscv: Add KASAN support kasan: Add riscv to KASAN documentation. Documentation/dev-tools/kasan.rst | 4 +- arch/riscv/Kconfig | 1 + arch/riscv/include/asm/kasan.h | 27 ++++++++ arch/riscv/include/asm/pgtable-64.h | 5 ++ arch/riscv/include/asm/string.h | 9 +++ arch/riscv/kernel/head.S | 3 + arch/riscv/kernel/riscv_ksyms.c | 2 + arch/riscv/kernel/setup.c | 5 ++ arch/riscv/kernel/vmlinux.lds.S | 1 + arch/riscv/lib/memcpy.S | 5 +- arch/riscv/lib/memset.S | 5 +- arch/riscv/mm/Makefile | 6 ++ arch/riscv/mm/kasan_init.c | 104 ++++++++++++++++++++++++++++ mm/kasan/common.c | 2 + 14 files changed, 173 insertions(+), 6 deletions(-) create mode 100644 arch/riscv/include/asm/kasan.h create mode 100644 arch/riscv/mm/kasan_init.c -- 2.17.0