mbox series

[v2,0/3] arm64/fpsimd: Fix use after free in SME when changing SVE VL

Message ID 20230720-arm64-fix-sve-sme-vl-change-v2-0-8eea06b82d57@kernel.org (mailing list archive)
Headers show
Series arm64/fpsimd: Fix use after free in SME when changing SVE VL | expand

Message

Mark Brown July 20, 2023, 6:38 p.m. UTC
This series fixes an issue which David Spickett found where if we change
the SVE VL while SME is in use we can end up attempting to save state to
an unallocated buffer and adds testing coverage for that plus a bit more
coverage of VL changes, just for paranioa.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
Changes in v2:
- Always reallocate the SVE state.
- Rebase onto v6.5-rc2.
- Link to v1: https://lore.kernel.org/r/20230713-arm64-fix-sve-sme-vl-change-v1-0-129dd8611413@kernel.org

---
Mark Brown (3):
      arm64/fpsimd: Ensure SME storage is allocated after SVE VL changes
      kselftest/arm64: Add a test case for SVE VL changes with SME active
      kselftest/arm64: Validate that changing one VL type does not affect another

 arch/arm64/kernel/fpsimd.c                    |  33 +++++--
 tools/testing/selftests/arm64/fp/vec-syscfg.c | 127 +++++++++++++++++++++++++-
 2 files changed, 148 insertions(+), 12 deletions(-)
---
base-commit: 06785562d1b99ff6dc1cd0af54be5e3ff999dc02
change-id: 20230713-arm64-fix-sve-sme-vl-change-60eb1fa6a707

Best regards,

Comments

Will Deacon July 21, 2023, 10:53 a.m. UTC | #1
On Thu, 20 Jul 2023 19:38:57 +0100, Mark Brown wrote:
> This series fixes an issue which David Spickett found where if we change
> the SVE VL while SME is in use we can end up attempting to save state to
> an unallocated buffer and adds testing coverage for that plus a bit more
> coverage of VL changes, just for paranioa.
> 
> 

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

[1/3] arm64/fpsimd: Ensure SME storage is allocated after SVE VL changes
      https://git.kernel.org/arm64/c/d4d5be94a878

I'll look at the selftests stuff for 6.6 when I get to that (probably
next week).

Cheers,
Will Deacon July 27, 2023, 4:09 p.m. UTC | #2
On Thu, 20 Jul 2023 19:38:57 +0100, Mark Brown wrote:
> This series fixes an issue which David Spickett found where if we change
> the SVE VL while SME is in use we can end up attempting to save state to
> an unallocated buffer and adds testing coverage for that plus a bit more
> coverage of VL changes, just for paranioa.
> 
> 

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

[1/3] arm64/fpsimd: Ensure SME storage is allocated after SVE VL changes
      https://git.kernel.org/arm64/c/d4d5be94a878
[2/3] kselftest/arm64: Add a test case for SVE VL changes with SME active
      https://git.kernel.org/arm64/c/0c7c237b1c35
[3/3] kselftest/arm64: Validate that changing one VL type does not affect another
      https://git.kernel.org/arm64/c/0aeead9bb240

Cheers,