mbox series

[0/2] arm64: Fix for dynamic SCS under full LTO take #2

Message ID 20240123133052.1417449-4-ardb+git@google.com (mailing list archive)
Headers show
Series arm64: Fix for dynamic SCS under full LTO take #2 | expand

Message

Ard Biesheuvel Jan. 23, 2024, 1:30 p.m. UTC
From: Ard Biesheuvel <ardb@kernel.org>

Disabling unwind table generation turns out not to fix the issue with
full LTO and dynamic shadow call stack, as reported by Sami. So instead,
disable LTO for the compilation unit in question.

Implemented as a revert + new patch so that only the real fix needs to
go to -stable.

Cc: Sami Tolvanen <samitolvanen@google.com>
Cc: Kees Cook <keescook@chromium.org>

Ard Biesheuvel (2):
  arm64: Revert "scs: Work around full LTO issue with dynamic SCS"
  arm64: scs: Disable LTO for SCS patching code

 arch/arm64/kernel/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Sami Tolvanen Jan. 23, 2024, 5:06 p.m. UTC | #1
Hi Ard,

On Tue, Jan 23, 2024 at 1:31 PM Ard Biesheuvel <ardb+git@google.com> wrote:
>
> From: Ard Biesheuvel <ardb@kernel.org>
>
> Disabling unwind table generation turns out not to fix the issue with
> full LTO and dynamic shadow call stack, as reported by Sami. So instead,
> disable LTO for the compilation unit in question.
>
> Implemented as a revert + new patch so that only the real fix needs to
> go to -stable.
>
> Cc: Sami Tolvanen <samitolvanen@google.com>
> Cc: Kees Cook <keescook@chromium.org>
>
> Ard Biesheuvel (2):
>   arm64: Revert "scs: Work around full LTO issue with dynamic SCS"
>   arm64: scs: Disable LTO for SCS patching code
>
>  arch/arm64/kernel/Makefile | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Thanks for the patches! I confirmed that this fixes the boot issue I was seeing.

Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Tested-by: Sami Tolvanen <samitolvanen@google.com>

Sami
Kees Cook Jan. 23, 2024, 10:27 p.m. UTC | #2
On Tue, Jan 23, 2024 at 02:30:53PM +0100, Ard Biesheuvel wrote:
> From: Ard Biesheuvel <ardb@kernel.org>
> 
> Disabling unwind table generation turns out not to fix the issue with
> full LTO and dynamic shadow call stack, as reported by Sami. So instead,
> disable LTO for the compilation unit in question.
> 
> Implemented as a revert + new patch so that only the real fix needs to
> go to -stable.
> 
> Cc: Sami Tolvanen <samitolvanen@google.com>
> Cc: Kees Cook <keescook@chromium.org>
> 
> Ard Biesheuvel (2):
>   arm64: Revert "scs: Work around full LTO issue with dynamic SCS"
>   arm64: scs: Disable LTO for SCS patching code
> 
>  arch/arm64/kernel/Makefile | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Thanks for figuring this out!

Reviewed-by: Kees Cook <keescook@chromium.org>
Will Deacon Jan. 30, 2024, 1:14 p.m. UTC | #3
On Tue, 23 Jan 2024 14:30:53 +0100, Ard Biesheuvel wrote:
> From: Ard Biesheuvel <ardb@kernel.org>
> 
> Disabling unwind table generation turns out not to fix the issue with
> full LTO and dynamic shadow call stack, as reported by Sami. So instead,
> disable LTO for the compilation unit in question.
> 
> Implemented as a revert + new patch so that only the real fix needs to
> go to -stable.
> 
> [...]

Applied to arm64 (for-next/fixes), thanks!

[1/2] arm64: Revert "scs: Work around full LTO issue with dynamic SCS"
      https://git.kernel.org/arm64/c/2fa28abd1090
[2/2] arm64: scs: Disable LTO for SCS patching code
      https://git.kernel.org/arm64/c/d104a6fef3fe

Cheers,