x86/lam: Disable ADDRESS_MASKING in most cases
PATCH 1/1 x86/lam: Disable ADDRESS_MASKING in most cases
Intel feature Linear Address Masking (LAM) has a weakness related to transient execution as described in the SLAM paper[1]. Unless Linear Address Space Separation (LASS) is enabled this weakness may be exploitable.
Until kernel adds support for LASS[2], only allow LAM for COMPILE_TEST, or when speculation mitigations have been disabled at compile time, otherwise keep LAM disabled.
[1] SLAM: https://download.vusec.net/papers/slam_sp24.pdf
[2] LASS: https://lore.kernel.org/lkml/[email protected]/
--- arch/x86/Kconfig | 1 + 1 file changed, 1 insertion(+)
arch/x86/Kconfig +1 -0
@@ -2270,6 +2270,7 @@ config RANDOMIZE_MEMORY_PHYSICAL_PADDING config ADDRESS_MASKING bool "Linear Address Masking support" depends on X86_64 + depends on COMPILE_TEST || !SPECULATION_MITIGATIONS # wait for LASS help Linear Address Masking (LAM) modifies the checking that is applied to 64-bit linear addresses, allowing software to use of the
base-commit: 0dd3ee31125508cd67f7e7172247f05b7fd1753a
Signature · 1 line
2.34.1
Quoted 9 lines · Pawan Gupta
Intel feature Linear Address Masking (LAM) has a weakness related to transient execution as described in the SLAM paper[1]. Unless Linear Address Space Separation (LASS) is enabled this weakness may be exploitable.
Until kernel adds support for LASS[2], only allow LAM for
COMPILE_TEST, or when speculation mitigations have been disabled at compile time, otherwise keep LAM disabled.
It worth adding that there's no HW on market that supports LAM, so nobody affected by the issue.
Quoted 5 lines
[1] SLAM: https://download.vusec.net/papers/slam_sp24.pdf
[2] LASS: https://lore.kernel.org/lkml/[email protected]/Cc [email protected] # v6.4+Signed-off-by Pawan Gupta <[email protected]>
Signature · 1 line
Kiryl Shutsemau / Kirill A. Shutemov
Quoted 6 lines · On Fri, Jan 19, 2024 at 07:58:28AM +0300, [email protected] wrote:
Quoted 5 lines · Pawan Gupta
Intel feature Linear Address Masking (LAM) has a weakness related to transient execution as described in the SLAM paper[1]. Unless Linear Address Space Separation (LASS) is enabled this weakness may be exploitable.
Quoted 7 lines
Quoted 4 lines
Until kernel adds support for LASS[2], only allow LAM for
COMPILE_TEST, or when speculation mitigations have been disabled at compile time, otherwise keep LAM disabled.It worth adding that there's no HW on market that supports LAM, so nobody affected by the issue.
Right.
Quoted 7 lines
Quoted 5 lines
[1] SLAM: https://download.vusec.net/papers/slam_sp24.pdf
[2] LASS: https://lore.kernel.org/lkml/[email protected]/Cc [email protected] # v6.4+Signed-off-by Pawan Gupta <[email protected]>
Thanks.
Hi Pawan,
arch/x86/Kconfig config RANDOMIZE_MEMORY_PHYSICAL_PADDING · line 2273
Quoted 12 lines · Pawan Gupta
arch/x86/Kconfig | 1 + 1 file changed, 1 insertion(+)arch/x86/Kconfig +1
-0@@ -2270,6 +2270,7 @@ config RANDOMIZE_MEMORY_PHYSICAL_PADDING config ADDRESS_MASKING bool "Linear Address Masking support" depends on X86_64 + depends on COMPILE_TEST || !SPECULATION_MITIGATIONS # wait for LASS
I was wondering if the COMPILE_TEST dependency here is a bit redundant.
Having ADDRESS_MASKING depend on just !SPECULATION_MITIGATIONS might be enough to get the LAM code compile tested through various configurations.
I don't have a strong preference here. Mainly looking to understand the reasoning. Other than that the patch looks fine to me.
Sohil
Quoted 3 lines
arch/x86/Kconfig +0
-0help Linear Address Masking (LAM) modifies the checking that is applied to 64-bit linear addresses, allowing software to use of the
Quoted 18 lines · Sohil Mehta
Hi Pawan,
arch/x86/Kconfig config RANDOMIZE_MEMORY_PHYSICAL_PADDING · line 2273
Quoted 12 lines · Pawan Gupta
arch/x86/Kconfig | 1 + 1 file changed, 1 insertion(+)arch/x86/Kconfig +1
-0@@ -2270,6 +2270,7 @@ config RANDOMIZE_MEMORY_PHYSICAL_PADDING config ADDRESS_MASKING bool "Linear Address Masking support" depends on X86_64 + depends on COMPILE_TEST || !SPECULATION_MITIGATIONS # wait for LASSI was wondering if the
COMPILE_TESTdependency here is a bit redundant.
Quoted 5 lines
Having
ADDRESS_MASKINGdepend on just !SPECULATION_MITIGATIONS might be enough to get the LAM code compile tested through various configurations.I don't have a strong preference here. Mainly looking to understand the reasoning. Other than that the patch looks fine to me.
The goal is to compile test it whenever possible. As SPECULATION_MITIGATIONS are ON by default, it wont get tested for most configuration.
Sohil Mehta
Reviewed-byQuoted 3 lines · Pawan Gupta
The goal is to compile test it whenever possible. As
SPECULATION_MITIGATIONSare ON by default, it wont get tested for most configuration.
Sure, that would help increase the compile coverage. I wasn't sure how much of a difference it would make. Anyways, the restriction is expected to be short lived until LASS is available.
Please feel free to add:
Quoted 9 lines · Sohil Mehta
Quoted 3 lines · Pawan Gupta
The goal is to compile test it whenever possible. As
SPECULATION_MITIGATIONSare ON by default, it wont get tested for most configuration.Sure, that would help increase the compile coverage. I wasn't sure how much of a difference it would make. Anyways, the restriction is expected to be short lived until LASS is available.
True.
Quoted 2 lines
Please feel free to add:
Reviewed-by Sohil Mehta <[email protected]>
Thanks