* [PATCH AUTOSEL 6.3 4/7] riscv: Fix EFI stub usage of KASAN instrumented strcmp function
[not found] <20230509035455.59524-1-sashal@kernel.org>
@ 2023-05-09 3:54 ` Sasha Levin
2023-05-09 3:54 ` [PATCH AUTOSEL 6.3 5/7] riscv: Unconditionnally select KASAN_VMALLOC if KASAN Sasha Levin
1 sibling, 0 replies; 4+ messages in thread
From: Sasha Levin @ 2023-05-09 3:54 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Alexandre Ghiti, Ard Biesheuvel, Atish Patra, Palmer Dabbelt,
Sasha Levin, paul.walmsley, palmer, aou, linux-riscv
From: Alexandre Ghiti <alexghiti@rivosinc.com>
[ Upstream commit 617955ca6e275c4dd0dcf5316fca7fc04a8f2fe6 ]
The EFI stub must not use any KASAN instrumented code as the kernel
proper did not initialize the thread pointer and the mapping for the
KASAN shadow region.
Avoid using the generic strcmp function, instead use the one in
drivers/firmware/efi/libstub/string.c.
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
Link: https://lore.kernel.org/r/20230203075232.274282-5-alexghiti@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/riscv/kernel/image-vars.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/riscv/kernel/image-vars.h b/arch/riscv/kernel/image-vars.h
index 7e2962ef73f92..15616155008cc 100644
--- a/arch/riscv/kernel/image-vars.h
+++ b/arch/riscv/kernel/image-vars.h
@@ -23,8 +23,6 @@
* linked at. The routines below are all implemented in assembler in a
* position independent manner
*/
-__efistub_strcmp = strcmp;
-
__efistub__start = _start;
__efistub__start_kernel = _start_kernel;
__efistub__end = _end;
--
2.39.2
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH AUTOSEL 6.3 5/7] riscv: Unconditionnally select KASAN_VMALLOC if KASAN
[not found] <20230509035455.59524-1-sashal@kernel.org>
2023-05-09 3:54 ` [PATCH AUTOSEL 6.3 4/7] riscv: Fix EFI stub usage of KASAN instrumented strcmp function Sasha Levin
@ 2023-05-09 3:54 ` Sasha Levin
2023-05-12 9:51 ` Alexandre Ghiti
1 sibling, 1 reply; 4+ messages in thread
From: Sasha Levin @ 2023-05-09 3:54 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Alexandre Ghiti, Björn Töpel, Palmer Dabbelt,
Sasha Levin, paul.walmsley, palmer, aou, linux-riscv
From: Alexandre Ghiti <alexghiti@rivosinc.com>
[ Upstream commit 864046c512c2cd8418dc928b91981fb12a80396c ]
If KASAN is enabled, VMAP_STACK depends on KASAN_VMALLOC so enable
KASAN_VMALLOC with KASAN so that we can enable VMAP_STACK by default.
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Reviewed-by: Björn Töpel <bjorn@rivosinc.com>
Link: https://lore.kernel.org/r/20230203075232.274282-7-alexghiti@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/riscv/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index eb7f29a412f87..d6aad84efb95e 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -118,6 +118,7 @@ config RISCV
select HAVE_SYSCALL_TRACEPOINTS
select IRQ_DOMAIN
select IRQ_FORCED_THREADING
+ select KASAN_VMALLOC if KASAN
select MODULES_USE_ELF_RELA if MODULES
select MODULE_SECTIONS if MODULES
select OF
--
2.39.2
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH AUTOSEL 6.3 5/7] riscv: Unconditionnally select KASAN_VMALLOC if KASAN
2023-05-09 3:54 ` [PATCH AUTOSEL 6.3 5/7] riscv: Unconditionnally select KASAN_VMALLOC if KASAN Sasha Levin
@ 2023-05-12 9:51 ` Alexandre Ghiti
2023-05-18 17:45 ` Sasha Levin
0 siblings, 1 reply; 4+ messages in thread
From: Alexandre Ghiti @ 2023-05-12 9:51 UTC (permalink / raw)
To: Sasha Levin, linux-kernel, stable
Cc: Alexandre Ghiti, Björn Töpel, Palmer Dabbelt,
paul.walmsley, palmer, aou, linux-riscv
Hi Sasha,
On 5/9/23 05:54, Sasha Levin wrote:
> From: Alexandre Ghiti <alexghiti@rivosinc.com>
>
> [ Upstream commit 864046c512c2cd8418dc928b91981fb12a80396c ]
>
> If KASAN is enabled, VMAP_STACK depends on KASAN_VMALLOC so enable
> KASAN_VMALLOC with KASAN so that we can enable VMAP_STACK by default.
>
> Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
> Reviewed-by: Björn Töpel <bjorn@rivosinc.com>
> Link: https://lore.kernel.org/r/20230203075232.274282-7-alexghiti@rivosinc.com
> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
> arch/riscv/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index eb7f29a412f87..d6aad84efb95e 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -118,6 +118,7 @@ config RISCV
> select HAVE_SYSCALL_TRACEPOINTS
> select IRQ_DOMAIN
> select IRQ_FORCED_THREADING
> + select KASAN_VMALLOC if KASAN
> select MODULES_USE_ELF_RELA if MODULES
> select MODULE_SECTIONS if MODULES
> select OF
KASAN_VMALLOC is broken for any kernel < 6.4, so this one should not be
backported to any kernel (5.15, 6.1, 6.2, 6.3).
Thanks,
Alex
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH AUTOSEL 6.3 5/7] riscv: Unconditionnally select KASAN_VMALLOC if KASAN
2023-05-12 9:51 ` Alexandre Ghiti
@ 2023-05-18 17:45 ` Sasha Levin
0 siblings, 0 replies; 4+ messages in thread
From: Sasha Levin @ 2023-05-18 17:45 UTC (permalink / raw)
To: Alexandre Ghiti
Cc: linux-kernel, stable, Alexandre Ghiti, Björn Töpel,
Palmer Dabbelt, paul.walmsley, palmer, aou, linux-riscv
On Fri, May 12, 2023 at 11:51:03AM +0200, Alexandre Ghiti wrote:
>Hi Sasha,
>
>On 5/9/23 05:54, Sasha Levin wrote:
>>From: Alexandre Ghiti <alexghiti@rivosinc.com>
>>
>>[ Upstream commit 864046c512c2cd8418dc928b91981fb12a80396c ]
>>
>>If KASAN is enabled, VMAP_STACK depends on KASAN_VMALLOC so enable
>>KASAN_VMALLOC with KASAN so that we can enable VMAP_STACK by default.
>>
>>Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
>>Reviewed-by: Björn Töpel <bjorn@rivosinc.com>
>>Link: https://lore.kernel.org/r/20230203075232.274282-7-alexghiti@rivosinc.com
>>Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
>>Signed-off-by: Sasha Levin <sashal@kernel.org>
>>---
>> arch/riscv/Kconfig | 1 +
>> 1 file changed, 1 insertion(+)
>>
>>diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
>>index eb7f29a412f87..d6aad84efb95e 100644
>>--- a/arch/riscv/Kconfig
>>+++ b/arch/riscv/Kconfig
>>@@ -118,6 +118,7 @@ config RISCV
>> select HAVE_SYSCALL_TRACEPOINTS
>> select IRQ_DOMAIN
>> select IRQ_FORCED_THREADING
>>+ select KASAN_VMALLOC if KASAN
>> select MODULES_USE_ELF_RELA if MODULES
>> select MODULE_SECTIONS if MODULES
>> select OF
>
>
>KASAN_VMALLOC is broken for any kernel < 6.4, so this one should not
>be backported to any kernel (5.15, 6.1, 6.2, 6.3).
Ack, dropped. Thanks!
--
Thanks,
Sasha
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-05-18 17:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20230509035455.59524-1-sashal@kernel.org>
2023-05-09 3:54 ` [PATCH AUTOSEL 6.3 4/7] riscv: Fix EFI stub usage of KASAN instrumented strcmp function Sasha Levin
2023-05-09 3:54 ` [PATCH AUTOSEL 6.3 5/7] riscv: Unconditionnally select KASAN_VMALLOC if KASAN Sasha Levin
2023-05-12 9:51 ` Alexandre Ghiti
2023-05-18 17:45 ` Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox