|
|
Log in / Subscribe / Register

KASAN support for RISC-V

From:  Nick Hu <nickhu-AT-andestech.com>
To:  <aryabinin-AT-virtuozzo.com>, <glider-AT-google.com>, <dvyukov-AT-google.com>, <corbet-AT-lwn.net>, <paul.walmsley-AT-sifive.com>, <palmer-AT-sifive.com>, <aou-AT-eecs.berkeley.edu>, <tglx-AT-linutronix.de>, <gregkh-AT-linuxfoundation.org>, <alankao-AT-andestech.com>, <Anup.Patel-AT-wdc.com>, <atish.patra-AT-wdc.com>, <kasan-dev-AT-googlegroups.com>, <linux-doc-AT-vger.kernel.org>, <linux-kernel-AT-vger.kernel.org>, <linux-riscv-AT-lists.infradead.org>, <linux-mm-AT-kvack.org>, <green.hu-AT-gmail.com>
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>
Cc:  Nick Hu <nickhu-AT-andestech.com>
Archive-link:  Article

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



Copyright © 2019, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds