Skip to main content
Vulnerability Database/CVE-2026-98197

CVE-2026-98197: Linux Kernel w83791d Use-After-Free Flaw

CVE-2026-98197 is a use-after-free vulnerability in the Linux kernel w83791d hardware monitoring driver that can cause stale memory access. This article covers the technical details, affected versions, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-98197 Overview

CVE-2026-98197 is a Linux kernel vulnerability in the w83791d hardware monitoring (hwmon) driver. The driver fails to remove the w83791d_group_fanpwm45 sysfs group during normal driver teardown. When the driver is unbound, these optional fan/pwm 4-5 sysfs files can remain on the I2C client device. The file callbacks access driver data that was allocated through the device-managed (devm) allocator and freed after unbind. This results in accesses to stale driver data, a use-after-free condition in kernel space.

Critical Impact

Local users with access to the leftover sysfs files can trigger reads of freed kernel memory, enabling potential kernel memory corruption or information disclosure on systems using the w83791d sensor driver.

Affected Products

  • Linux kernel versions containing the w83791d hwmon driver prior to the fix
  • Stable kernel branches referenced by commits 081e3a78, 0ff9c777, 2c381e6e, 2ccf6c51, 2dd37d00, 583e04e8, b1d419eb, and f6e2ab72
  • Systems using Winbond W83791D hardware monitoring chips over I2C

Discovery Timeline

  • 2026-10-06 - CVE-2026-98197 published to NVD
  • 2026-10-07 - Last updated in NVD database

Technical Details for CVE-2026-98197

Vulnerability Analysis

The w83791d driver provides hwmon support for Winbond W83791D sensors over I2C. During w83791d_probe(), when the fan/pwm 4-5 pins are not configured as GPIO, the driver creates the w83791d_group_fanpwm45 sysfs attribute group on the I2C client device. The probe error path correctly unwinds this group when a later initialization step fails. The normal remove path, however, only tears down w83791d_group and leaves w83791d_group_fanpwm45 registered. After the driver is unbound, the sysfs files remain exposed in /sys. The callbacks associated with these files dereference driver private data allocated with devm_kzalloc(), which the device model releases immediately after unbind. Any subsequent read or write to the stale sysfs attribute dereferences freed memory. The issue was identified through manual code inspection and resolved by removing w83791d_group_fanpwm45 during the normal remove path as well.

Root Cause

The root cause is asymmetric resource management between the probe error path and the remove path. The driver registers two sysfs groups but only unregisters one at remove time, violating the symmetry required for safe teardown of devm-managed resources.

Attack Vector

Exploitation requires local access with sufficient privileges to open sysfs files under the hwmon device and to trigger the driver unbind sequence. An attacker who can access the leftover attributes after unbind can read or write stale kernel memory, producing use-after-free conditions in the kernel address space.

No verified public exploit code exists for this issue. See the referenced kernel commits for the fix implementation details.

Detection Methods for CVE-2026-98197

Indicators of Compromise

  • Kernel oops or KASAN: use-after-free reports originating from w83791d sysfs show/store callbacks
  • Unexpected read errors or stale values from /sys/class/hwmon/*/fan4_*, fan5_*, pwm4, or pwm5 attributes after driver unbind
  • dmesg entries referencing w83791d immediately following I2C device removal or module unload

Detection Strategies

  • Audit loaded kernel modules on monitored hosts and inventory systems running the w83791d driver
  • Enable CONFIG_KASAN on test kernels to surface use-after-free accesses in the hwmon subsystem
  • Monitor /sys/bus/i2c/drivers/w83791d/unbind operations and correlate with subsequent sysfs reads

Monitoring Recommendations

  • Collect kernel ring buffer logs centrally and alert on oops or KASAN signatures referencing hwmon drivers
  • Track kernel package versions across the fleet and flag hosts running kernels prior to the fixed stable releases
  • Record auditd events for processes writing to /sys/bus/i2c/drivers/*/bind and unbind

How to Mitigate CVE-2026-98197

Immediate Actions Required

  • Apply the stable kernel update containing the w83791d remove-path fix for your distribution
  • Restrict local shell access on systems using Winbond W83791D hardware monitoring
  • Limit write access to /sys/bus/i2c/drivers/w83791d/ interfaces to the root user only

Patch Information

The fix is distributed across multiple stable branches via commits 081e3a78, 0ff9c777, 2c381e6e, 2ccf6c51, 2dd37d00, 583e04e8, b1d419eb, and f6e2ab72. Rebuild and reboot into a patched kernel across affected hosts.

Workarounds

  • Blacklist the w83791d module on systems that do not require Winbond W83791D sensor telemetry
  • Avoid runtime unbind of the w83791d driver on unpatched kernels; keep the driver bound until a scheduled reboot into a patched kernel
  • Mount sysfs with reduced permissions and ensure non-root users cannot read hwmon attributes on sensitive hosts
bash
# Blacklist the vulnerable driver until a patched kernel is deployed
echo "blacklist w83791d" | sudo tee /etc/modprobe.d/blacklist-w83791d.conf
sudo update-initramfs -u

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.