From mboxrd@z Thu Jan 1 00:00:00 1970 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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=no 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 C09FDC352AA for ; Wed, 2 Oct 2019 06:17:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A160F21783 for ; Wed, 2 Oct 2019 06:17:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727382AbfJBGR2 (ORCPT ); Wed, 2 Oct 2019 02:17:28 -0400 Received: from 59-120-53-16.HINET-IP.hinet.net ([59.120.53.16]:48694 "EHLO ATCSQR.andestech.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727042AbfJBGR1 (ORCPT ); Wed, 2 Oct 2019 02:17:27 -0400 Received: from mail.andestech.com (atcpcs16.andestech.com [10.0.1.222]) by ATCSQR.andestech.com with ESMTP id x9260iVl065604; Wed, 2 Oct 2019 14:00:44 +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; Wed, 2 Oct 2019 14:16:11 +0800 From: Nick Hu To: , , , , , , , , , , , , , , , , , CC: Nick Hu Subject: [PATCH v2 0/2] KASAN support for RISC-V Date: Wed, 2 Oct 2019 14:16:03 +0800 Message-ID: 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 x9260iVl065604 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 Nick Hu (2): kasan: Archs don't check memmove if not support it. riscv: Add KASAN support 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 + 13 files changed, 171 insertions(+), 4 deletions(-) create mode 100644 arch/riscv/include/asm/kasan.h create mode 100644 arch/riscv/mm/kasan_init.c -- 2.17.0