Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp48926pxb; Tue, 12 Jan 2021 19:41:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJziSfLEXFD5L3btC+z42+wCQ/d9dCaIWCxH6U17651VszuEo17/floUbYJRg/W49DBY7Sci X-Received: by 2002:a17:906:4e50:: with SMTP id g16mr91327ejw.191.1610509273849; Tue, 12 Jan 2021 19:41:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610509273; cv=none; d=google.com; s=arc-20160816; b=h3VRE+xV0Jo90l6dxm7RnLsIdg0VCfhz5rp9g7FT1CB9e80eBkruD94RVLl4xAAJb5 W6TNmvbTSF2YafNNmllAYDFinim/THodcC9/qYVcrhFS4dnEJvuM/ZoVYDM3uQr62024 wZqbrp8CYNVKNG2qsWqfP2O7nR05kYyhrC99/KvhdL9EYtOXYUH+Qw8o8rZrZWnSDmjw S6uMZEA7Nj11LZkJRi1sw6BQrHXqVm3sEx9O/xvcSJl/Fg+SqGdFf8efmKrXFQD/WPUV CytHUBxq8kRdKwTytc+INwU3ra5mBmAwS2y91jNSyFgrunOyrDPS4grVMsiaMOAabJaR z2xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=TYKiZ70QHlvmE3rgboyFD6zvGFIqO5v8pvVutSV877I=; b=iHChV1C6voCdrYCclkcjAKwy/7VHujtcc9or2T3mXDa7EVn0WhgAr8vAw8e1maxYG+ xgfPLG0bjGIH0eFb3h138IRv2K6G/1tbmHNCQgSrCezY2Qs39fmhmAUiEuYJkd7SWq3H bslt5R23u+vOEe5cARN3F/WLz+ZUY8qeIgjFN6qlpvJ9QysLmBl1tou9+5yqiPUpyrhv 2ARhl6sey6wOFh3TOBJK9856yXBqTnazrE1SbPx/Hd7dOilIl4X22zIaoji+Xx0lH81u JU5N1XmW0ZesMkqhJ+tr9DacRHWPKL+MY62gt5HkDkjQEhHU1EUchJhuq3uZ5ogvE8OX 6+vA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n16si317742edb.217.2021.01.12.19.40.50; Tue, 12 Jan 2021 19:41:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728051AbhAMCdz (ORCPT + 99 others); Tue, 12 Jan 2021 21:33:55 -0500 Received: from atcsqr.andestech.com ([60.248.187.195]:58887 "EHLO ATCSQR.andestech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727999AbhAMCdy (ORCPT ); Tue, 12 Jan 2021 21:33:54 -0500 X-Greylist: delayed 489 seconds by postgrey-1.27 at vger.kernel.org; Tue, 12 Jan 2021 21:33:54 EST Received: from ATCSQR.andestech.com (localhost [127.0.0.2] (may be forged)) by ATCSQR.andestech.com with ESMTP id 10D2N2sj039155 for ; Wed, 13 Jan 2021 10:23:02 +0800 (GMT-8) (envelope-from nylon7@andestech.com) Received: from mail.andestech.com (atcpcs16.andestech.com [10.0.1.222]) by ATCSQR.andestech.com with ESMTP id 10D2LWuX038877; Wed, 13 Jan 2021 10:21:32 +0800 (GMT-8) (envelope-from nylon7@andestech.com) Received: from atcfdc88.andestech.com (10.0.15.120) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.487.0; Wed, 13 Jan 2021 10:24:12 +0800 From: Nylon Chen To: , CC: , , , , , , , , , Subject: [PATCH 1/1] riscv: Fix KASAN memory mapping. Date: Wed, 13 Jan 2021 10:24:10 +0800 Message-ID: <20210113022410.9057-1-nylon7@andestech.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.0.15.120] X-DNSRBL: X-MAIL: ATCSQR.andestech.com 10D2LWuX038877 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nick Hu Use virtual address instead of physical address when translating the address to shadow memory by kasan_mem_to_shadow(). Signed-off-by: Nick Hu Signed-off-by: Nylon Chen --- arch/riscv/mm/kasan_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/riscv/mm/kasan_init.c b/arch/riscv/mm/kasan_init.c index 12ddd1f6bf70..a8a2ffd9114a 100644 --- a/arch/riscv/mm/kasan_init.c +++ b/arch/riscv/mm/kasan_init.c @@ -93,8 +93,8 @@ void __init kasan_init(void) VMALLOC_END)); for_each_mem_range(i, &_start, &_end) { - void *start = (void *)_start; - void *end = (void *)_end; + void *start = (void *)__va(_start); + void *end = (void *)__va(_end); if (start >= end) break; -- 2.17.1