Disable sv57 as the userspace is not ready

Bug #1991790 reported by Alexandre Ghiti
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux-riscv (Ubuntu)
Fix Released
Undecided
Emil Renner Berthing

Bug Description

[ Impact ]

* Linux 5.18 merged support for 5-level page tables (sv57), and it
  does it such that 5-level page tables are used whenever the
  system supports it.

* So far only Qemu support sv57, but it breaks Go since Go uses
  too many of the upper bits of pointers to store data, and is not
  yet ready for sv57. It probably breaks other types of software
  using too many bits for this "pointer tagging" technique too.
  At the moment, there is no way to indicate to the kernel to
  downgrade to sv48, so we must patch the kernel:

diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index 2c4a64e97aec..18a0c70ed313 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -775,6 +775,10 @@ static __init void set_satp_mode(void)
                disable_pgtable_l4();
        }

+ /* UBUNTU: Force disable sv57 and fallback to sv48 */
+ if (pgtable_l5_enabled)
+ disable_pgtable_l5();
+
        memset(early_pg_dir, 0, PAGE_SIZE);
        memset(early_p4d, 0, PAGE_SIZE);
        memset(early_pud, 0, PAGE_SIZE);

[ Test Plan ]

* Build an image with the patched kernel and make sure snapd and
  other Go programs work correctly and that you can compile a
  simple helloworld written in Go.

[ Where problems could occur ]

* The patch could be buggy.

* Qemu will no longer work with > 256 TB of memory.

CVE References

description: updated
description: updated
description: updated
Changed in linux-riscv (Ubuntu):
assignee: nobody → Emil Renner Berthing (esmil)
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (160.9 KiB)

This bug was fixed in the package linux-riscv - 5.19.0-1003.3

---------------
linux-riscv (5.19.0-1003.3) kinetic; urgency=medium

  * kinetic/linux-riscv: 5.19.0-1003.3 -proposed tracker (LP: #1992335)

  * Packaging resync (LP: #1786013)
    - debian/dkms-versions -- update from kernel-versions (main/master)

  * Disable sv57 as the userspace is not ready (LP: #1991790)
    - SAUCE: riscv: mm: Force disable sv57

  * rcu_sched detected stalls on CPUs/tasks (LP: #1967130)
    - [Packaging] Keep VMAP_STACK off

  * earlyconsole prints question marks on 5.19.0-1002-generic (LP: #1988984)
    - [Config] Set CONFIG_PWM_SIFIVE=m for

  * Miscellaneous Ubuntu changes
    - [Packaging] suffixless backport kernel, handle it as an exception
    - [Packaging] Add helper scripts
    - [Packaging] Use all annotations from parent
    - [Packaging] Review master changes
    - [Packaging] Adjust ABI after config changes.

  [ Ubuntu: 5.19.0-19.19 ]

  * kinetic/linux: 5.19.0-19.19 -proposed tracker (LP: #1990960)
  * kinetic: apply new apparmor and LSM stacking patch set (LP: #1989983)
    - Revert "Revert "Revert "UBUNTU: SAUCE: LSM: Specify which LSM to display
      (using struct cred as input)"""
    - Revert "Revert "Revert "UBUNTU: SAUCE: apparmor: Fix build error, make sk
      parameter const"""
    - Revert "Revert "Revert "UBUNTU: SAUCE: LSM: Use lsmblob in
      smk_netlbl_mls()"""
    - Revert "Revert "Revert "UBUNTU: SAUCE: LSM: change ima_read_file() to use
      lsmblob"""
    - Revert "Revert "Revert "UBUNTU: SAUCE: apparmor: rename kzfree() to
      kfree_sensitive()"""
    - Revert "Revert "Revert "UBUNTU: SAUCE: Audit: Fix for missing NULL check"""
    - Revert "Revert "Revert "UBUNTU: SAUCE: AppArmor: Remove the exclusive
      flag"""
    - Revert "Revert "Revert "UBUNTU: SAUCE: LSM: Add /proc attr entry for full
      LSM context"""
    - Revert "Revert "Revert "UBUNTU: SAUCE: Audit: Add a new record for multiple
      object LSM attributes"""
    - Revert "Revert "Revert "UBUNTU: SAUCE: Audit: Fix incorrect static inline
      function declration."""
    - Revert "Revert "Revert "UBUNTU: SAUCE: Audit: Add new record for multiple
      process LSM attributes"""
    - Revert "Revert "Revert "UBUNTU: SAUCE: NET: Store LSM netlabel data in a
      lsmblob"""
    - Revert "Revert "Revert "UBUNTU: SAUCE: LSM: security_secid_to_secctx in
      netlink netfilter"""
    - Revert "Revert "Revert "UBUNTU: SAUCE: LSM: Use lsmcontext in
      security_inode_getsecctx"""
    - Revert "Revert "Revert "UBUNTU: SAUCE: LSM: Use lsmcontext in
      security_secid_to_secctx"""
    - Revert "Revert "Revert "UBUNTU: SAUCE: LSM: Ensure the correct LSM context
      releaser"""
    - Revert "Revert "Revert "UBUNTU: SAUCE: LSM: Specify which LSM to display"""
    - Revert "Revert "Revert "UBUNTU: SAUCE: IMA: Change internal interfaces to
      use lsmblobs"""
    - Revert "Revert "Revert "UBUNTU: SAUCE: LSM: Use lsmblob in
      security_cred_getsecid"""
    - Revert "Revert "Revert "UBUNTU: SAUCE: LSM: Use lsmblob in
      security_inode_getsecid"""
    - Revert "Revert "Revert "UBUNTU: SAUCE: LSM: Use lsmblob in
      security_task_getsecid"""
    - Rever...

Changed in linux-riscv (Ubuntu):
status: New → Fix Released
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the linux-hwe-5.19/5.19.0-24.25~22.04.1 kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-jammy' to 'verification-done-jammy'. If the problem still exists, change the tag 'verification-needed-jammy' to 'verification-failed-jammy'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: kernel-spammed-jammy-linux-hwe-5.19 verification-needed-jammy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.