CVE-2026-142976: w1: remove the master's files before taking its locks

Published Dec 3, 2026
·
Updated

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

1 affected component
Linux Linux kernel

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Compensating control

    In __w1_remove_master_device(), remove the master's files with w1_destroy_master_attributes() before taking the master and list locks.

Event History

Dec 3, 2026
CVE Published
via MITRE·09:17 AM
Data Sourced
via MITRE·09:17 AM
Description

Frequently Asked Questions

1

Which systems are exposed to this issue?

Systems using the Linux kernel w1 subsystem with a bus master that can be removed are exposed during master-device removal. The description specifically identifies unplugging a DS2490 USB adapter as an example trigger.

2

What activity can cause the removal path to stall?

The issue occurs when master attributes are removed while the master's mutex and list_mutex are held. Removing the sysfs files waits for active callbacks, while callbacks such as reads of w1_master_slaves can attempt to acquire those same locks.

3

Can concurrent sysfs access make the condition more likely?

Yes. The affected files are readable by all users, and reads can hold an active kernfs reference while waiting on the master's locks. Writes to w1_master_add can also attach a slave during teardown if the files remain available, and writes to w1_master_search can wake the master thread.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203