AZL-117848: CVE-2026-142976 affecting package kernel 6.6.161.1-1
In the Linux kernel, the following vulnerability has been resolved:
w1: remove the master's files before taking its locks
w1removemasterdevice() calls w1destroymasterattributes() with both the mutex of the master and listmutex held. Removing the files waits for the callbacks which are running, and nearly all of them take one of these two locks:
w1removemasterdevice() read() of .../w1masterslaves mutexlock(&dev->mutex) kernfs active reference mutexlock(&dev->listmutex) w1masterattributeshowslaves() w1destroymasterattributes() mutexlock(&md->listmutex) sysfsremovegroup() waits waits for the reference
The files are readable for everybody, and a bus master goes away when, for instance, a DS2490 USB adapter is unplugged.
Remove the files first, before the locks are taken. That has to be done before the slaves are detached and not afterwards: as long as the files exist, a write to w1masteradd could attach a new slave behind the back of this function, which would then wait for the reference count of the master for ever. And it is done before the thread is stopped, because a write to w1mastersearch wakes the thread up.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In the w1 master removal path, remove the master's files before taking its locks.
Event History
Frequently Asked Questions
Which systems are realistically exposed to this issue?
Systems using the Linux kernel w1 subsystem with a bus master are exposed, particularly where users can access the w1 master sysfs files. The description specifically identifies DS2490 USB adapter removal as an example of a bus master going away.
What conditions are needed to trigger the problem?
The issue involves concurrent removal of a w1 bus master and callbacks operating through its sysfs files. Reads of w1_master_slaves and writes to w1_master_add or w1_master_search are relevant operations during master removal.
Why does sysfs file access matter during device removal?
The w1 master files are readable by everyone, and file removal waits for active callbacks to finish. If removal occurs while the master's mutex or list_mutex is held, callbacks that need those locks can block, creating a deadlock condition.
What change resolves the race during master removal?
The resolved approach removes the master's files before taking the master locks. This must occur before slave detachment so that a write to w1_master_add cannot attach a new slave while removal is in progress.