Public bug reported:

[Impact]
The lenovo_se10_wdt watchdog driver does not support the Lenovo ThinkEdge
SE10 Gen 2 platform. The Gen 2 uses a different SuperIO chip and different
DMI product names. Without this patch, the hardware watchdog is unavailable
on Gen 2 systems.
Additionally, the original driver has a use-after-free risk in the module
exit path and a resource leak if platform_device_add() fails.

[Fix]
The first patch adds the Gen 2 chip ID (0x5652) and DMI entries for the
new platform. The second sets se10_pdev to NULL on removal to prevent
use-after-free, removes the DMI callback in favor of direct device
creation, and handles platform_device_add() failure properly.

7b25feb19ce8 watchdog: lenovo_se10_wdt: Add support for SE10 Gen 2 platform
3394e894880a watchdog: lenovo_se10_wdt: Fix use-after-free and resource leak 
risk

[Test Plan]
On a Lenovo ThinkEdge SE10 Gen 2 system:
1. Load the driver:
   $ sudo modprobe lenovo_se10_wdt
2. Enable systemd watchdog:
   $ sudo sed -i 's/.*RuntimeWatchdogSec=.*/RuntimeWatchdogSec=60/' 
/etc/systemd/system.conf
   $ sudo systemctl daemon-reexec
3. Trigger kernel panic to confirm watchdog fires:
   $ echo 0 | sudo tee /proc/sys/kernel/panic
   $ echo c | sudo tee /proc/sysrq-trigger
   (system should reboot after ~60 seconds)

[Where problems could occur]
The patches only affect the lenovo_se10_wdt driver. No other watchdog
drivers or subsystems are touched.
The first patch adds new DMI IDs and a chip ID check. If matching is
wrong, the driver could load on unsupported hardware or fail to load
on supported hardware.
The second patch changes module init/exit flow. A regression here could
prevent the driver from loading or cause a crash on module removal.
Risk is low — changes are small and self-contained within a single
platform-specific driver.

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

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

** Package changed: ubuntu => linux (Ubuntu)

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

** Description changed:

  [Impact]
  The lenovo_se10_wdt watchdog driver does not support the Lenovo ThinkEdge
  SE10 Gen 2 platform. The Gen 2 uses a different SuperIO chip and different
  DMI product names. Without this patch, the hardware watchdog is unavailable
  on Gen 2 systems.
  Additionally, the original driver has a use-after-free risk in the module
  exit path and a resource leak if platform_device_add() fails.
  
  [Fix]
  The first patch adds the Gen 2 chip ID (0x5652) and DMI entries for the
  new platform. The second sets se10_pdev to NULL on removal to prevent
  use-after-free, removes the DMI callback in favor of direct device
  creation, and handles platform_device_add() failure properly.
  
  7b25feb19ce8 watchdog: lenovo_se10_wdt: Add support for SE10 Gen 2 platform
  3394e894880a watchdog: lenovo_se10_wdt: Fix use-after-free and resource leak 
risk
  
- 
  [Test Plan]
  On a Lenovo ThinkEdge SE10 Gen 2 system:
- 
  1. Load the driver:
-    $ sudo modprobe lenovo_se10_wdt
+    $ sudo modprobe lenovo_se10_wdt
  2. Enable systemd watchdog:
-    $ sudo sed -i 's/.*RuntimeWatchdogSec=.*/RuntimeWatchdogSec=60/' 
/etc/systemd/system.conf
-    $ sudo systemctl daemon-reexec
+    $ sudo sed -i 's/.*RuntimeWatchdogSec=.*/RuntimeWatchdogSec=60/' 
/etc/systemd/system.conf
+    $ sudo systemctl daemon-reexec
  3. Trigger kernel panic to confirm watchdog fires:
-    $ echo 0 | sudo tee /proc/sys/kernel/panic
-    $ echo c | sudo tee /proc/sysrq-trigger
-    (system should reboot after ~60 seconds)
+    $ echo 0 | sudo tee /proc/sys/kernel/panic
+    $ echo c | sudo tee /proc/sysrq-trigger
+    (system should reboot after ~60 seconds)
  
  [Where problems could occur]
  The patches only affect the lenovo_se10_wdt driver. No other watchdog
  drivers or subsystems are touched.
  The first patch adds new DMI IDs and a chip ID check. If matching is
  wrong, the driver could load on unsupported hardware or fail to load
  on supported hardware.
  The second patch changes module init/exit flow. A regression here could
  prevent the driver from loading or cause a crash on module removal.
  Risk is low — changes are small and self-contained within a single
  platform-specific driver.

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

Title:
  watchdog: lenovo_se10_wdt: Add SE10 Gen 2 support

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


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

Reply via email to