public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] riscv: define ILLEGAL_POINTER_VALUE for 64bit
@ 2024-07-05 17:02 Jisheng Zhang
  2024-07-06  0:50 ` Jisheng Zhang
  2024-09-17 13:00 ` patchwork-bot+linux-riscv
  0 siblings, 2 replies; 4+ messages in thread
From: Jisheng Zhang @ 2024-07-05 17:02 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou; +Cc: linux-riscv, linux-kernel

This is used in poison.h for poison pointer offset. Based on current
SV39, SV48 and SV57 vm layout, 0xdead000000000000 is a proper value
that is not mappable, this can avoid potentially turning an oops to
an expolit.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---

Since v1:
 - fix typo:s/SV59/SV57

 arch/riscv/Kconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index c51b32a8ddff..c992eabbd002 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -313,6 +313,11 @@ config GENERIC_HWEIGHT
 config FIX_EARLYCON_MEM
 	def_bool MMU
 
+config ILLEGAL_POINTER_VALUE
+	hex
+	default 0 if 32BIT
+	default 0xdead000000000000 if 64BIT
+
 config PGTABLE_LEVELS
 	int
 	default 5 if 64BIT
-- 
2.43.0


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

* Re: [PATCH v2] riscv: define ILLEGAL_POINTER_VALUE for 64bit
  2024-07-05 17:02 [PATCH v2] riscv: define ILLEGAL_POINTER_VALUE for 64bit Jisheng Zhang
@ 2024-07-06  0:50 ` Jisheng Zhang
  2024-09-15  6:55   ` Palmer Dabbelt
  2024-09-17 13:00 ` patchwork-bot+linux-riscv
  1 sibling, 1 reply; 4+ messages in thread
From: Jisheng Zhang @ 2024-07-06  0:50 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou; +Cc: linux-riscv, linux-kernel

On Sat, Jul 06, 2024 at 01:02:10AM +0800, Jisheng Zhang wrote:
> This is used in poison.h for poison pointer offset. Based on current
> SV39, SV48 and SV57 vm layout, 0xdead000000000000 is a proper value
> that is not mappable, this can avoid potentially turning an oops to
> an expolit.

Maybe I also need to cc stable? This is a secure hole fix patch.

> 
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> ---
> 
> Since v1:
>  - fix typo:s/SV59/SV57
> 
>  arch/riscv/Kconfig | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index c51b32a8ddff..c992eabbd002 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -313,6 +313,11 @@ config GENERIC_HWEIGHT
>  config FIX_EARLYCON_MEM
>  	def_bool MMU
>  
> +config ILLEGAL_POINTER_VALUE
> +	hex
> +	default 0 if 32BIT
> +	default 0xdead000000000000 if 64BIT
> +
>  config PGTABLE_LEVELS
>  	int
>  	default 5 if 64BIT
> -- 
> 2.43.0
> 
> 
> _______________________________________________
> 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 v2] riscv: define ILLEGAL_POINTER_VALUE for 64bit
  2024-07-06  0:50 ` Jisheng Zhang
@ 2024-09-15  6:55   ` Palmer Dabbelt
  0 siblings, 0 replies; 4+ messages in thread
From: Palmer Dabbelt @ 2024-09-15  6:55 UTC (permalink / raw)
  To: jszhang; +Cc: Paul Walmsley, aou, linux-riscv, linux-kernel

On Fri, 05 Jul 2024 17:50:10 PDT (-0700), jszhang@kernel.org wrote:
> On Sat, Jul 06, 2024 at 01:02:10AM +0800, Jisheng Zhang wrote:
>> This is used in poison.h for poison pointer offset. Based on current
>> SV39, SV48 and SV57 vm layout, 0xdead000000000000 is a proper value
>> that is not mappable, this can avoid potentially turning an oops to
>> an expolit.
>
> Maybe I also need to cc stable? This is a secure hole fix patch.

Ya, and I guess it's just been broken forever?  I stuck a

Fixes: fbe934d69eb7 ("RISC-V: Build Infrastructure")

it should show up on for-next, assuming the tests pass...

>
>>
>> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
>> ---
>>
>> Since v1:
>>  - fix typo:s/SV59/SV57
>>
>>  arch/riscv/Kconfig | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
>> index c51b32a8ddff..c992eabbd002 100644
>> --- a/arch/riscv/Kconfig
>> +++ b/arch/riscv/Kconfig
>> @@ -313,6 +313,11 @@ config GENERIC_HWEIGHT
>>  config FIX_EARLYCON_MEM
>>  	def_bool MMU
>>
>> +config ILLEGAL_POINTER_VALUE
>> +	hex
>> +	default 0 if 32BIT
>> +	default 0xdead000000000000 if 64BIT
>> +
>>  config PGTABLE_LEVELS
>>  	int
>>  	default 5 if 64BIT
>> --
>> 2.43.0
>>
>>
>> _______________________________________________
>> 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 v2] riscv: define ILLEGAL_POINTER_VALUE for 64bit
  2024-07-05 17:02 [PATCH v2] riscv: define ILLEGAL_POINTER_VALUE for 64bit Jisheng Zhang
  2024-07-06  0:50 ` Jisheng Zhang
@ 2024-09-17 13:00 ` patchwork-bot+linux-riscv
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+linux-riscv @ 2024-09-17 13:00 UTC (permalink / raw)
  To: Jisheng Zhang; +Cc: linux-riscv, paul.walmsley, palmer, aou, linux-kernel

Hello:

This patch was applied to riscv/linux.git (for-next)
by Palmer Dabbelt <palmer@rivosinc.com>:

On Sat,  6 Jul 2024 01:02:10 +0800 you wrote:
> This is used in poison.h for poison pointer offset. Based on current
> SV39, SV48 and SV57 vm layout, 0xdead000000000000 is a proper value
> that is not mappable, this can avoid potentially turning an oops to
> an expolit.
> 
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> 
> [...]

Here is the summary with links:
  - [v2] riscv: define ILLEGAL_POINTER_VALUE for 64bit
    https://git.kernel.org/riscv/c/5c178472af24

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2024-09-17 13:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-05 17:02 [PATCH v2] riscv: define ILLEGAL_POINTER_VALUE for 64bit Jisheng Zhang
2024-07-06  0:50 ` Jisheng Zhang
2024-09-15  6:55   ` Palmer Dabbelt
2024-09-17 13:00 ` patchwork-bot+linux-riscv

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox