Public bug reported:

This bug targets the linux-amd-embedded kernel (Ubuntu 26.04 Resolute,
7.0, amd64). linux-amd-embedded is not yet available in the archive, so
the bug is filed against the linux package for now.

[Impact]
Two issues in the AMD node / SMN code (arch/x86/kernel/amd_node.c):

 * On virtualized systems the number of nodes does not have to match the
   number of AMD PCI roots. On a Xen PVH dom0, roots_per_node can be
   calculated as 0, which leads to a divide by zero in amd_smn_init().

 * amd_smn_read()/amd_smn_write() are exported and always available, even
   if amd_smn_init() fails. In that case 'amd_roots' is NULL and
   __amd_smn_rw() can dereference it.

Both fixes are tagged for stable upstream, but they are not part of the
7.0 stable series.

[Fix]
Cherry-pick the following commits from mainline (v7.3-rc3) into
linux-amd-embedded:
 * 72bd92bd8190 ("x86/amd_node: Avoid divide by zero on virtualized systems")
 * aefdbd574a36 ("x86/amd_node: Fix potential NULL pointer dereference")

[Test Plan]
 * Build the linux-amd-embedded kernel for all flavours.
 * Boot the kernel in an LXD VM.

[Where problems could occur]
The changes are limited to the SMN initialization and access paths in
arch/x86/kernel/amd_node.c. A regression could affect drivers using SMN
access on AMD systems, e.g. SMN reads or writes returning an error
instead of data.

** Affects: linux (Ubuntu)
     Importance: Undecided
         Status: New

** Affects: linux (Ubuntu Resolute)
     Importance: High
     Assignee: Krystian Kaniewski (kkaniewski)
         Status: Confirmed

** Also affects: linux (Ubuntu Resolute)
   Importance: Undecided
       Status: New

** Changed in: linux (Ubuntu Resolute)
       Status: New => Confirmed

** Changed in: linux (Ubuntu Resolute)
     Assignee: (unassigned) => Krystian Kaniewski (kkaniewski)

** Changed in: linux (Ubuntu Resolute)
   Importance: Undecided => High

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2173540

Title:
  linux-amd-embedded: x86/amd_node: Fix divide by zero on virtualized
  systems and potential NULL pointer dereference

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2173540/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to