diff --git a/ksan-riscv.patch b/ksan-riscv.patch index 46b1a3c1c..3b5464dce 100644 --- a/ksan-riscv.patch +++ b/ksan-riscv.patch @@ -1,267 +1,10 @@ -From patchwork Mon Oct 28 02:40:59 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Nick Hu -X-Patchwork-Id: 11214467 -Return-Path: - -Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org - [172.30.200.123]) - by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6F4FA1709 - for ; - Mon, 28 Oct 2019 02:42:20 +0000 (UTC) -Received: from bombadil.infradead.org (bombadil.infradead.org - [198.137.202.133]) - (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) - (No client certificate requested) - by mail.kernel.org (Postfix) with ESMTPS id 15CFD20663 - for ; - Mon, 28 Oct 2019 02:42:20 +0000 (UTC) -Authentication-Results: mail.kernel.org; - dkim=pass (2048-bit key) header.d=lists.infradead.org - header.i=@lists.infradead.org header.b="e67ifBqF" -DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 15CFD20663 -Authentication-Results: mail.kernel.org; - dmarc=none (p=none dis=none) header.from=andestech.com -Authentication-Results: mail.kernel.org; - spf=none - smtp.mailfrom=linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org -DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; - d=lists.infradead.org; s=bombadil.20170209; h=Sender: - Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: - List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: - Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: - Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: - List-Owner; bh=8dHgnDrKykGBMOQSQGrFLtpkUSzDRl+8ozm7D51vnLU=; b=e67ifBqFqPXkoW - 7hhBoyw+gFoGimICpKI1Zle610wALtXT0lwtnibm6cdHn+5/KFbwU2Sh4IJLMWIdYN8PujdiE2V2X - S/Sf5rcSN4usfibA2fXYg3SH1EMm/686dhO1HFFJI1PSPAzlEV6j/MC3eFfAWRx8SWDa1zLRvRtWE - 4BRVP8aVyhr6icgPMxIElFRsLb24gO1Ap3sb9Mn8QKGLg7NH3vh6/1HxgpnDorHwZQT33L1Rz6Z5p - PVziK+ZHlntdfhuX6vwpifWd8fCfdxNwwPg6p9jRHH7zUinW7z9lka0qEi08ID1my+O49q0zVnD/o - dksn//G3/8UvVOPoQiYg==; -Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) - by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) - id 1iOuz4-00070G-9E; Mon, 28 Oct 2019 02:42:18 +0000 -Received: from 59-120-53-16.hinet-ip.hinet.net ([59.120.53.16] - helo=ATCSQR.andestech.com) - by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) - id 1iOuz1-0006rg-0W - for linux-riscv@lists.infradead.org; Mon, 28 Oct 2019 02:42:17 +0000 -Received: from mail.andestech.com (atcpcs16.andestech.com [10.0.1.222]) - by ATCSQR.andestech.com with ESMTP id x9S2O9tf087229; - Mon, 28 Oct 2019 10:24:09 +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:38 +0800 -From: Nick Hu -To: , , , - , , , - , , - , , - , , - , , - , , - , -Subject: [PATCH v4 1/3] kasan: No KASAN's memmove check if archs don't have - it. -Date: Mon, 28 Oct 2019 10:40:59 +0800 -Message-ID: <20191028024101.26655-2-nickhu@andestech.com> -X-Mailer: git-send-email 2.17.0 -In-Reply-To: <20191028024101.26655-1-nickhu@andestech.com> -References: <20191028024101.26655-1-nickhu@andestech.com> -MIME-Version: 1.0 -X-Originating-IP: [10.0.15.65] -X-DNSRBL: -X-MAIL: ATCSQR.andestech.com x9S2O9tf087229 -X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 -X-CRM114-CacheID: sfid-20191027_194215_341108_2F0BA4C1 -X-CRM114-Status: UNSURE ( 6.06 ) -X-CRM114-Notice: Please train this message. -X-Spam-Score: 0.4 (/) -X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: - Content analysis details: (0.4 points) - pts rule name description - ---- ---------------------- - -------------------------------------------------- - 0.0 TVD_RCVD_IP Message was received from an IP address - -0.0 SPF_PASS SPF: sender matches SPF record - 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record - 0.4 RDNS_DYNAMIC Delivered to internal network by host with - dynamic-looking rDNS -X-BeenThere: linux-riscv@lists.infradead.org -X-Mailman-Version: 2.1.29 -Precedence: list -List-Id: -List-Unsubscribe: , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: , - -Cc: Nick Hu -Sender: "linux-riscv" -Errors-To: - linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org +From 0a4b63f55fec9c1c505c5429afbc1e512df2415e Mon Sep 17 00:00:00 2001 +From: Fedora Kernel Team +Date: Wed, 11 Dec 2019 11:55:51 +0000 +Subject: [PATCH] RISCV KASAN -If archs don't have memmove then the C implementation from lib/string.c is used, -and then it's instrumented by compiler. So there is no need to add KASAN's -memmove to manual checks. - -Signed-off-by: Nick Hu -Acked-by: Dmitry Vyukov -Acked-by: Andrey Ryabinin ---- - mm/kasan/common.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/mm/kasan/common.c b/mm/kasan/common.c -index 6814d6d6a023..897f9520bab3 100644 ---- a/mm/kasan/common.c -+++ b/mm/kasan/common.c -@@ -107,6 +107,7 @@ void *memset(void *addr, int c, size_t len) - return __memset(addr, c, len); - } - -+#ifdef __HAVE_ARCH_MEMMOVE - #undef memmove - void *memmove(void *dest, const void *src, size_t len) - { -@@ -115,6 +116,7 @@ void *memmove(void *dest, const void *src, size_t len) - - return __memmove(dest, src, len); - } -+#endif - - #undef memcpy - void *memcpy(void *dest, const void *src, size_t len) - -From patchwork Mon Oct 28 02:41:00 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Nick Hu -X-Patchwork-Id: 11214471 -Return-Path: - -Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org - [172.30.200.123]) - by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CDBB21709 - for ; - Mon, 28 Oct 2019 02:42:31 +0000 (UTC) -Received: from bombadil.infradead.org (bombadil.infradead.org - [198.137.202.133]) - (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) - (No client certificate requested) - by mail.kernel.org (Postfix) with ESMTPS id A34E020663 - for ; - Mon, 28 Oct 2019 02:42:31 +0000 (UTC) -Authentication-Results: mail.kernel.org; - dkim=pass (2048-bit key) header.d=lists.infradead.org - header.i=@lists.infradead.org header.b="XIVWjzwA" -DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A34E020663 -Authentication-Results: mail.kernel.org; - dmarc=none (p=none dis=none) header.from=andestech.com -Authentication-Results: mail.kernel.org; - spf=none - smtp.mailfrom=linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org -DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; - d=lists.infradead.org; s=bombadil.20170209; h=Sender: - Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: - List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: - Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: - Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: - List-Owner; bh=VELidK9BtLK5YxwB14xraoIFR9Cx0TeaSAG8mcHxahM=; b=XIVWjzwAoWtnpV - H4Bg1Ic85i8N09weWQu+W9abxCdDUY16G1Yj4fMF6TlDFXdNGrf8QUyyBV3NQZTdBZ06KYiqq9b7B - sY4h8CK7bLkiFzDeSUr59yNr2xnpAO9Ektbx2NNf4fHW9i3JmkEagyL1DA51KtT6cPrphGC7MpUoA - I4Qn1F/2vXVm2Qyb6PJP3aP6Vf3v8h8UtMir4/iCIu7J8lOot1skuscrjwMEbmx3a1Ea0y/7qnfUe - MrWMzQftQ0fMa5dCNyiKnif2gn6Cl9HMCDv38gjHGthYE4DiA7dpBY2S/0fc1rx04luwYonPzw2DW - /NuqrSNWGOOfElFUtY+w==; -Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) - by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) - id 1iOuzG-0007Ba-Cd; Mon, 28 Oct 2019 02:42:30 +0000 -Received: from 59-120-53-16.hinet-ip.hinet.net ([59.120.53.16] - helo=ATCSQR.andestech.com) - by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) - id 1iOuz5-0006zx-65 - for linux-riscv@lists.infradead.org; Mon, 28 Oct 2019 02:42:26 +0000 -Received: from mail.andestech.com (atcpcs16.andestech.com [10.0.1.222]) - by ATCSQR.andestech.com with ESMTP id x9S2OOBs087256; - Mon, 28 Oct 2019 10:24:24 +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:53 +0800 -From: Nick Hu -To: , , , - , , , - , , - , , - , , - , , - , , - , -Subject: [PATCH v4 2/3] riscv: Add KASAN support -Date: Mon, 28 Oct 2019 10:41:00 +0800 -Message-ID: <20191028024101.26655-3-nickhu@andestech.com> -X-Mailer: git-send-email 2.17.0 -In-Reply-To: <20191028024101.26655-1-nickhu@andestech.com> -References: <20191028024101.26655-1-nickhu@andestech.com> -MIME-Version: 1.0 -X-Originating-IP: [10.0.15.65] -X-DNSRBL: -X-MAIL: ATCSQR.andestech.com x9S2OOBs087256 -X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 -X-CRM114-CacheID: sfid-20191027_194219_545019_85EF7682 -X-CRM114-Status: GOOD ( 17.48 ) -X-Spam-Score: 0.4 (/) -X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: - Content analysis details: (0.4 points) - pts rule name description - ---- ---------------------- - -------------------------------------------------- - 0.0 TVD_RCVD_IP Message was received from an IP address - -0.0 SPF_PASS SPF: sender matches SPF record - 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record - 0.4 RDNS_DYNAMIC Delivered to internal network by host with - dynamic-looking rDNS -X-BeenThere: linux-riscv@lists.infradead.org -X-Mailman-Version: 2.1.29 -Precedence: list -List-Id: -List-Unsubscribe: , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: , - -Cc: Nick Hu -Sender: "linux-riscv" -Errors-To: - linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org - -This patch ports the feature Kernel Address SANitizer (KASAN). - -Note: The start address of shadow memory is at the beginning of kernel -space, which is 2^64 - (2^39 / 2) in SV39. The size of the kernel space is -2^38 bytes so the size of shadow memory should be 2^38 / 8. Thus, the -shadow memory would not overlap with the fixmap area. - -There are currently two limitations in this port, - -1. RV64 only: KASAN need large address space for extra shadow memory -region. - -2. KASAN can't debug the modules since the modules are allocated in VMALLOC -area. We mapped the shadow memory, which corresponding to VMALLOC area, to -the kasan_early_shadow_page because we don't have enough physical space for -all the shadow memory corresponding to VMALLOC area. - -Signed-off-by: Nick Hu -Reported-by: Greentime Hu --- + 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 ++ @@ -274,12 +17,28 @@ Reported-by: Greentime Hu arch/riscv/lib/memset.S | 5 +- arch/riscv/mm/Makefile | 6 ++ arch/riscv/mm/kasan_init.c | 104 ++++++++++++++++++++++++++++ - 12 files changed, 169 insertions(+), 4 deletions(-) + 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 +diff --git a/Documentation/dev-tools/kasan.rst b/Documentation/dev-tools/kasan.rst +index 5252961..a97f5b0 100644 +--- a/Documentation/dev-tools/kasan.rst ++++ b/Documentation/dev-tools/kasan.rst +@@ -21,8 +21,8 @@ global variables yet. + + Tag-based KASAN is only supported in Clang and requires version 7.0.0 or later. + +-Currently generic KASAN is supported for the x86_64, arm64, xtensa and s390 +-architectures, and tag-based KASAN is supported only for arm64. ++Currently generic KASAN is supported for the x86_64, arm64, xtensa, s390 and ++riscv architectures, and tag-based KASAN is supported only for arm64. + + Usage + ----- diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig -index 8eebbc8860bb..ca2fc8ba8550 100644 +index 8eebbc8..ca2fc8b 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -61,6 +61,7 @@ config RISCV @@ -292,7 +51,7 @@ index 8eebbc8860bb..ca2fc8ba8550 100644 default 18 if 64BIT diff --git a/arch/riscv/include/asm/kasan.h b/arch/riscv/include/asm/kasan.h new file mode 100644 -index 000000000000..eee6e6588b12 +index 0000000..eee6e65 --- /dev/null +++ b/arch/riscv/include/asm/kasan.h @@ -0,0 +1,27 @@ @@ -324,10 +83,10 @@ index 000000000000..eee6e6588b12 +#endif +#endif /* __ASM_KASAN_H */ diff --git a/arch/riscv/include/asm/pgtable-64.h b/arch/riscv/include/asm/pgtable-64.h -index 7df8daa66cc8..777a1dddb3df 100644 +index 7463098..36e638d 100644 --- a/arch/riscv/include/asm/pgtable-64.h +++ b/arch/riscv/include/asm/pgtable-64.h -@@ -59,6 +59,11 @@ static inline unsigned long pud_page_vaddr(pud_t pud) +@@ -58,6 +58,11 @@ static inline unsigned long pud_page_vaddr(pud_t pud) return (unsigned long)pfn_to_virt(pud_val(pud) >> _PAGE_PFN_SHIFT); } @@ -340,7 +99,7 @@ index 7df8daa66cc8..777a1dddb3df 100644 static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr) diff --git a/arch/riscv/include/asm/string.h b/arch/riscv/include/asm/string.h -index 1b5d44585962..924af13f8555 100644 +index 1b5d445..924af13 100644 --- a/arch/riscv/include/asm/string.h +++ b/arch/riscv/include/asm/string.h @@ -11,8 +11,17 @@ @@ -362,7 +121,7 @@ index 1b5d44585962..924af13f8555 100644 +#endif #endif /* _ASM_RISCV_STRING_H */ diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S -index 72f89b7590dd..95eca23cd811 100644 +index 72f89b7..95eca23 100644 --- a/arch/riscv/kernel/head.S +++ b/arch/riscv/kernel/head.S @@ -102,6 +102,9 @@ clear_bss_done: @@ -376,7 +135,7 @@ index 72f89b7590dd..95eca23cd811 100644 call parse_dtb tail start_kernel diff --git a/arch/riscv/kernel/riscv_ksyms.c b/arch/riscv/kernel/riscv_ksyms.c -index 4800cf703186..376bba7f65ce 100644 +index 4800cf7..376bba7 100644 --- a/arch/riscv/kernel/riscv_ksyms.c +++ b/arch/riscv/kernel/riscv_ksyms.c @@ -14,3 +14,5 @@ EXPORT_SYMBOL(__asm_copy_to_user); @@ -386,7 +145,7 @@ index 4800cf703186..376bba7f65ce 100644 +EXPORT_SYMBOL(__memset); +EXPORT_SYMBOL(__memcpy); diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c -index a990a6cb184f..41f7eae9bc4d 100644 +index 845ae0e..cfb833a 100644 --- a/arch/riscv/kernel/setup.c +++ b/arch/riscv/kernel/setup.c @@ -23,6 +23,7 @@ @@ -395,9 +154,9 @@ index a990a6cb184f..41f7eae9bc4d 100644 #include +#include - #ifdef CONFIG_DUMMY_CONSOLE - struct screen_info screen_info = { -@@ -70,6 +71,10 @@ void __init setup_arch(char **cmdline_p) + #include "head.h" + +@@ -72,6 +73,10 @@ void __init setup_arch(char **cmdline_p) swiotlb_init(1); #endif @@ -409,7 +168,7 @@ index a990a6cb184f..41f7eae9bc4d 100644 setup_smp(); #endif diff --git a/arch/riscv/kernel/vmlinux.lds.S b/arch/riscv/kernel/vmlinux.lds.S -index 23cd1a9e52a1..97009803ba9f 100644 +index 23cd1a9..9700980 100644 --- a/arch/riscv/kernel/vmlinux.lds.S +++ b/arch/riscv/kernel/vmlinux.lds.S @@ -46,6 +46,7 @@ SECTIONS @@ -421,7 +180,7 @@ index 23cd1a9e52a1..97009803ba9f 100644 _etext = .; } diff --git a/arch/riscv/lib/memcpy.S b/arch/riscv/lib/memcpy.S -index b4c477846e91..51ab716253fa 100644 +index b4c4778..51ab716 100644 --- a/arch/riscv/lib/memcpy.S +++ b/arch/riscv/lib/memcpy.S @@ -7,7 +7,8 @@ @@ -441,7 +200,7 @@ index b4c477846e91..51ab716253fa 100644 -END(memcpy) +END(__memcpy) diff --git a/arch/riscv/lib/memset.S b/arch/riscv/lib/memset.S -index 5a7386b47175..34c5360c6705 100644 +index 5a7386b..34c5360 100644 --- a/arch/riscv/lib/memset.S +++ b/arch/riscv/lib/memset.S @@ -8,7 +8,8 @@ @@ -461,7 +220,7 @@ index 5a7386b47175..34c5360c6705 100644 -END(memset) +END(__memset) diff --git a/arch/riscv/mm/Makefile b/arch/riscv/mm/Makefile -index 9d9a17335686..b8a8ca71f86e 100644 +index 9d9a173..b8a8ca7 100644 --- a/arch/riscv/mm/Makefile +++ b/arch/riscv/mm/Makefile @@ -17,3 +17,9 @@ ifeq ($(CONFIG_MMU),y) @@ -476,7 +235,7 @@ index 9d9a17335686..b8a8ca71f86e 100644 +endif diff --git a/arch/riscv/mm/kasan_init.c b/arch/riscv/mm/kasan_init.c new file mode 100644 -index 000000000000..f0cc86040587 +index 0000000..f0cc860 --- /dev/null +++ b/arch/riscv/mm/kasan_init.c @@ -0,0 +1,104 @@ @@ -584,133 +343,26 @@ index 000000000000..f0cc86040587 + memset(kasan_early_shadow_page, 0, PAGE_SIZE); + init_task.kasan_depth = 0; +} - -From patchwork Mon Oct 28 02:41:01 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Nick Hu -X-Patchwork-Id: 11214473 -Return-Path: - -Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org - [172.30.200.123]) - by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 49DF01709 - for ; - Mon, 28 Oct 2019 02:42:36 +0000 (UTC) -Received: from bombadil.infradead.org (bombadil.infradead.org - [198.137.202.133]) - (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) - (No client certificate requested) - by mail.kernel.org (Postfix) with ESMTPS id 1E1ED20B7C - for ; - Mon, 28 Oct 2019 02:42:36 +0000 (UTC) -Authentication-Results: mail.kernel.org; - dkim=pass (2048-bit key) header.d=lists.infradead.org - header.i=@lists.infradead.org header.b="Zn9dKEPm" -DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1E1ED20B7C -Authentication-Results: mail.kernel.org; - dmarc=none (p=none dis=none) header.from=andestech.com -Authentication-Results: mail.kernel.org; - spf=none - smtp.mailfrom=linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org -DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; - d=lists.infradead.org; s=bombadil.20170209; h=Sender: - Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: - List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: - Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: - Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: - List-Owner; bh=J/sqy2/UtfPQoirnXc+d0CNLf2adVmPHEl/h9PqZ6ug=; b=Zn9dKEPmWHeeOP - Ib9ZVMQu+ImT31utbdPBytAj55+oltx/8XxaP+DZwB4fikhkL1sbu/MUtZ2DyXr1fHpCnoW2Tv67y - IUCxFfjVJtHT+gRMBgwSJzDN8/jvGJFLaAi0kV8JyO3v4RFtHntQNRdAsyJ3jYgP4nUBuwQvGZPtQ - I9wK3jpebqWnGTcX7BUqKbrGzwEmAIW7DEp+RduJ+RAGv1I3MSpr7I02MjimpTS0+czfMPrdNDowT - PLWURpod0knfPezBQMo/2h0xPX0I0PJmZQQd7s2kVYoYCDIKzIgoADRDksC0YjLTPbLUUQddX5QFV - kUdnCcTSnBgsF3B2S/nA==; -Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) - by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) - id 1iOuzJ-0007EY-Mx; Mon, 28 Oct 2019 02:42:33 +0000 -Received: from 59-120-53-16.hinet-ip.hinet.net ([59.120.53.16] - helo=ATCSQR.andestech.com) - by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) - id 1iOuz9-00074Y-Ro - for linux-riscv@lists.infradead.org; Mon, 28 Oct 2019 02:42:27 +0000 -Received: from mail.andestech.com (atcpcs16.andestech.com [10.0.1.222]) - by ATCSQR.andestech.com with ESMTP id x9S2OTh5087266; - Mon, 28 Oct 2019 10:24:29 +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:57 +0800 -From: Nick Hu -To: , , , - , , , - , , - , , - , , - , , - , , - , -Subject: [PATCH v4 3/3] kasan: Add riscv to KASAN documentation. -Date: Mon, 28 Oct 2019 10:41:01 +0800 -Message-ID: <20191028024101.26655-4-nickhu@andestech.com> -X-Mailer: git-send-email 2.17.0 -In-Reply-To: <20191028024101.26655-1-nickhu@andestech.com> -References: <20191028024101.26655-1-nickhu@andestech.com> -MIME-Version: 1.0 -X-Originating-IP: [10.0.15.65] -X-DNSRBL: -X-MAIL: ATCSQR.andestech.com x9S2OTh5087266 -X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 -X-CRM114-CacheID: sfid-20191027_194224_185533_0F74B9C8 -X-CRM114-Status: UNSURE ( 6.72 ) -X-CRM114-Notice: Please train this message. -X-Spam-Score: 0.4 (/) -X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: - Content analysis details: (0.4 points) - pts rule name description - ---- ---------------------- - -------------------------------------------------- - 0.0 TVD_RCVD_IP Message was received from an IP address - -0.0 SPF_PASS SPF: sender matches SPF record - 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record - 0.4 RDNS_DYNAMIC Delivered to internal network by host with - dynamic-looking rDNS -X-BeenThere: linux-riscv@lists.infradead.org -X-Mailman-Version: 2.1.29 -Precedence: list -List-Id: -List-Unsubscribe: , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: , - -Cc: Nick Hu -Sender: "linux-riscv" -Errors-To: - linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org - -Add riscv to the KASAN documentation to mention that riscv -is supporting generic kasan now. - -Signed-off-by: Nick Hu ---- - Documentation/dev-tools/kasan.rst | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/Documentation/dev-tools/kasan.rst b/Documentation/dev-tools/kasan.rst -index b72d07d70239..34fbb7212cbc 100644 ---- a/Documentation/dev-tools/kasan.rst -+++ b/Documentation/dev-tools/kasan.rst -@@ -21,8 +21,8 @@ global variables yet. +diff --git a/mm/kasan/common.c b/mm/kasan/common.c +index 6814d6d..897f952 100644 +--- a/mm/kasan/common.c ++++ b/mm/kasan/common.c +@@ -107,6 +107,7 @@ void *memset(void *addr, int c, size_t len) + return __memset(addr, c, len); + } - Tag-based KASAN is only supported in Clang and requires version 7.0.0 or later. ++#ifdef __HAVE_ARCH_MEMMOVE + #undef memmove + void *memmove(void *dest, const void *src, size_t len) + { +@@ -115,6 +116,7 @@ void *memmove(void *dest, const void *src, size_t len) --Currently generic KASAN is supported for the x86_64, arm64, xtensa and s390 --architectures, and tag-based KASAN is supported only for arm64. -+Currently generic KASAN is supported for the x86_64, arm64, xtensa, s390 and -+riscv architectures, and tag-based KASAN is supported only for arm64. + return __memmove(dest, src, len); + } ++#endif - Usage - ----- + #undef memcpy + void *memcpy(void *dest, const void *src, size_t len) +-- +2.24.1 +