linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] riscv: Fix KASAN memory mapping.
@ 2021-01-13  2:24 Nylon Chen
  2021-01-14  4:57 ` Palmer Dabbelt
  0 siblings, 1 reply; 2+ messages in thread
From: Nylon Chen @ 2021-01-13  2:24 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: kasan-dev, aou, palmer, paul.walmsley, dvyukov, glider,
	aryabinin, alankao, nickhu, nylon7

From: Nick Hu <nickhu@andestech.com>

Use virtual address instead of physical address when translating
the address to shadow memory by kasan_mem_to_shadow().

Signed-off-by: Nick Hu <nickhu@andestech.com>
Signed-off-by: Nylon Chen <nylon7@andestech.com>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] riscv: Fix KASAN memory mapping.
  2021-01-13  2:24 [PATCH 1/1] riscv: Fix KASAN memory mapping Nylon Chen
@ 2021-01-14  4:57 ` Palmer Dabbelt
  0 siblings, 0 replies; 2+ messages in thread
From: Palmer Dabbelt @ 2021-01-14  4:57 UTC (permalink / raw)
  To: nylon7
  Cc: linux-riscv, linux-kernel, kasan-dev, aou, Paul Walmsley,
	dvyukov, glider, aryabinin, alankao, nickhu, nylon7

On Tue, 12 Jan 2021 18:24:10 PST (-0800), nylon7@andestech.com wrote:
> From: Nick Hu <nickhu@andestech.com>
>
> Use virtual address instead of physical address when translating
> the address to shadow memory by kasan_mem_to_shadow().
>
> Signed-off-by: Nick Hu <nickhu@andestech.com>
> Signed-off-by: Nylon Chen <nylon7@andestech.com>
> ---
>  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;

Thanks, this is on fixes.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-14  4:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-13  2:24 [PATCH 1/1] riscv: Fix KASAN memory mapping Nylon Chen
2021-01-14  4:57 ` Palmer Dabbelt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).