CVE-2025-71197: w1: therm: Fix off-by-one buffer overflow in alarms_store

Published Feb 4, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

w1: therm: Fix off-by-one buffer overflow in alarmsstore

The sysfs buffer passed to alarmsstore() is allocated with 'size + 1' bytes and a NUL terminator is appended. However, the 'size' argument does not account for this extra byte. The original code then allocated 'size' bytes and used strcpy() to copy 'buf', which always writes one byte past the allocated buffer since strcpy() copies until the NUL terminator at index 'size'.

Fix this by parsing the 'buf' parameter directly using simplestrtoll() without allocating any intermediate memory or string copying. This removes the overflow while simplifying the code.

Affected Software

2 affected componentsFixes available
Linux Linux kernel
debian/linux
6.1.176-16.1.190-16.12.107-16.12.115-27.2.12-17.2.15-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.1.176-1Fixed in 6.1.190-1Fixed in 6.12.107-1Fixed in 6.12.113-1Fixed in 7.2.12-1Fixed in 7.2.13-1
  2. Compensating control

    In w1 therm alarms_store, parse the buf parameter directly with simple_strtoll() without allocating intermediate memory or copying the string.

Event History

Feb 4, 2026
CVE Published
via MITRE·04:07 PM
Data Sourced
via MITRE·04:07 PM
Description
Data Sourced
via NVD·05:16 PM
Description

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What access is needed to trigger the flaw?

An attacker needs to provide input to the sysfs interface handled by alarms_store(). The provided information does not specify the required filesystem permissions or whether unprivileged users can write to that interface.

2

How can I determine whether a kernel source tree contains the fix?

Check the alarms_store() implementation in the w1 therm driver. A vulnerable implementation allocates size bytes and uses strcpy() on the sysfs buffer; the fixed implementation parses buf directly with simple_strtoll() and does not create an intermediate copied string.

3

What code change addresses the overflow?

The fix removes the allocation and strcpy() operation that copies the NUL terminator one byte beyond a size-byte allocation. It instead parses the supplied buffer directly using simple_strtoll().

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